I use
sh -xv my_script.sh
to debug the /bin/sh script. How do I debug /bin/bash scripts?
I am getting the following error and I need to know the line that needs to edit.
# ./batch_master.sh
'@'10.10.10.10.' (using password: NO)user 'companycuser
Doesn't this work?
Edit the script, add a -x option to the shell command line like:
or
It will print all executed commands and you can see what is done after what.
There has been a debugger for bash around for a since the turn of the century. See http://bashdb.sourceforge.net/
If you are going to use
set -x
tracing I recommend setting PS4 to: