4 ms·
What you really should do is to stick shopt -s failglob On top of shell scripts (and on ~/.bashrc), so that a glob that doesn't expand will always be an error
by nextaccountic 5y ago
What you really should do is to stick
shopt -s failglob
On top of shell scripts (and on ~/.bashrc), so that a glob that doesn't expand will always be an error. That way, you won't have that unquoted test.* work by accident, and thus it's easier to train yourself to always quote.
Or, just use zsh, which has this behavior by default.
Anyway here are other shell scripting tips: https://sipb.mit.edu/doc/safe-shell/ https://sipb.mit.edu/doc/safe-shell/