Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Very useful is:

    PS4='+ ${BASH_SOURCE:-}:${FUNCNAME[0]:-}:L${LINENO:-}:   '
When using `set -x` this makes it so that it shows the filename, function name, and line number. Which in larger Bash scripts can be quite handy in debugging.


WOW! Thanks! Power user of BASH for a long time and I did not know this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: