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.