Wednesday, April 11, 2018

debug hanging shell scripts

https://stackoverflow.com/questions/4640794/a-running-bash-script-is-hung-somewhere-can-i-find-out-what-line-it-is-on

set -x

lsof -p $pid

strace -p $pid -s 1024

/proc/$pid/environ

pstree -pl 21156 + cat /proc/15232/stack (15232 is the PID of the hanging process)

top

set -v or set -o verbose

http://bashdb.sourceforge.net/
https://www.shellcheck.net/
https://marketplace.visualstudio.com/items?itemName=rogalmic.bash-debug



No comments: