Debugging and Parameter problems of shell script

my question is that I want to execute a script on the remote machine centos, and then search for the answer I see in stackoverflow: shell-script-on-a-remote-machine/2732991-sharp2732991" rel=" nofollow noreferrer "> question
where the method is:

ssh root@MachineB "bash -s" < local_script.sh

I have tried this method, but now I need to specify parameters, such as local_script.sh-ub
and how to use bash-x when debugging scripts. You can see exactly where the execution failed, instead of printing and judging the execution result all the time.

Mar.31,2021

something like this

-sharp!/bin/bash

ssh root@192.2.1.160 <<'ENDSSH'
cd /home/app/scripts/
sh -x arr.sh 'test'
ENDSSH

that's what you do

-sharp!/bin/bash

ssh root@MachineB <<'ENDSSH'
cd xxx
sh -x local_script.sh -ub
ENDSSH
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36934-4ec8c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36934-4ec8c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?