debug scripts tip | PS4='+ ${BASH_SOURCE} : ${LINENO} :${FUNCNAME[0]}() '

root@ubuntu:/home/awsc1/linuxlessons/linuxscripts# bash -x debugPS4tip.sh  ls
+ PS4='+ ${BASH_SOURCE} : ${LINENO} :${FUNCNAME[0]}() '
+ debugPS4tip.sh : 3 :main() TEST_VAR=test
+ debugPS4tip.sh : 4 :main() echo test
test
+ debugPS4tip.sh : 10 :main() debug ls
+ debugPS4tip.sh : 7 :debug() echo 'Executing: ls'
Executing: ls
+ debugPS4tip.sh : 8 :debug() ls
associative_array  check_multiple_proc.sh  EOF.sh     paralleping.sh   showecho.sh     test.file
calc.sh    debugPS4tip.sh    funechoerror.sh  README.md      sleeppid.sh     trap.sh
capacity.sh    dollar_sc.sh    fu.sh     shellscripts.sh  systemdtarget.service
root@ubuntu:/home/awsc1/linuxlessons/linuxscripts#

Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all