* ALWAYS quote variable expansions (except in for loops)
* Use "-n" instead of "! -z"
* Fix bad redirection (|) when an OR (||) was intended
* Don't expand variables in printf format string (pass as argument)
* ALWAYS quote variable expansions (except in for loops)
* Avoid useless cat:
cat file | grep pattern ==> grep pattern file
* Did I mention to ALWAYS quote variable expansions?
Always use ShellCheck to write shell scripts!
https://marketplace.visualstudio.com/items?itemName=timonwong.shellcheck