News for hackers. Stuff that matters.
Re:Shell Script Best Practices, from a decade of scripting t... by therealjumbo on Thursday October 27, 2022 @11:01AM (#33358576)
This should be fixed with a shebang and shellcheck. If your shebang is #!/bin/sh, shellcheck will complain loudly about bash-isms. If production is sh and doesn't have bash, there's quite a few other bash-ism you want to check for. You can run shellcheck in CI to check your scripts and return non-zero if they aren't clean, and you can force off warnings for lines that are ok.

EDIT: I should have said, "could be fixed once and for all", "should" is just my opinion.

There are no comments on this comment yet.