Remix.run Logo
Debugging Bash Like a Sire(blog.brujordet.no)
2 points by gfalcao 10 hours ago | 1 comments
t43562 9 hours ago | parent [-]

I never thought of the idea of printing out a stack trace. A logging function is an example of such a good idea that is so obvious that I didn't think of it :-)

I use -e sometimes but I really dislike scripts that rely on it for all error handling instead of handling errors and logging them.

https://www.shellcheck.net/

^^ this tool has proven very useful for avoiding some of the most silly mistakes and making my scripts better. If you're maintaining scripts with other people then it is a great way of getting people to fix things without directly criticising them.