Hacker News new | ask | show | jobs
by jamespwilliams 931 days ago
Shellcheck is a godsend

https://github.com/jamespwilliams/strictbash, I wrote this little wrapper a while back that you can use as a shebang for scripts. It runs shellcheck for you before the script executes, so it’s not possible to run the script at all if there are failures. It also sets all the bash “strict mode” [0] flags.

[0] http://redsymbol.net/articles/unofficial-bash-strict-mode/

1 comments

That’s nice, but I suppose it only works if you run your own scripts, otherwise you’d be debugging and fixing every single script you have to run.
Some people may prefer that to “oh no, Steam did rm -rf $typo/“