|
|
|
|
|
by kenny_r
3382 days ago
|
|
ShellCheck warned me of a very similar issue in a script of mine recently. In that script I ran the following: rm -rf "${FOO}/"
ShellCheck helpfully warned me that that could have disastrous consequences when FOO is unset, instead it advised me to use this: rm -rf "${FOO:?}/"
I'd also like to point out that ShellCheck is in the AUR for users of Arch Linux[0], and that there's a handy plugin which I use for the Atom editor[1].[0] https://aur.archlinux.org/packages/shellcheck-git/ [1] https://atom.io/packages/linter-shellcheck |
|
[0] https://github.com/SublimeLinter/SublimeLinter-shellcheck