And always, always, use ShellCheck (https://www.shellcheck.net/) to catch most pitfalls and common mistakes on this powerful but dangerous language that is shell scripting.
[^1]: I think this gist is better than the original article in which it is based, because the article also suggested changing the IFS variable, which is not that good of an advice, so sadly the original text becomes a bad recommendation!
Good point, except if an important part of your complex script is really just plumbing the outputs of one program to the inputs of another. Because that's what shell scripting excels at. Calling an external process is a first-class citizen in shell, whereas it is a somewhat clunky thing (or at the very least, much more verbose) to do in any other languages.
There is a reading which suggests that an environment variable being unset caused an overabundance of files being deleted. `set -u` causes the script to exit if any variables are unset.
https://gist.github.com/robin-a-meade/58d60124b88b60816e8349... [^1]
And always, always, use ShellCheck (https://www.shellcheck.net/) to catch most pitfalls and common mistakes on this powerful but dangerous language that is shell scripting.
[^1]: I think this gist is better than the original article in which it is based, because the article also suggested changing the IFS variable, which is not that good of an advice, so sadly the original text becomes a bad recommendation!