Have ShellCheck review your script
Paste your script and it flags errors, bad practice and the classic traps, missing quotes first among them. It is the tool teams actually run before shipping a script.
Resource: shellcheck.net It is the one stop on this path you keep long after the learning is done. Wire it into a pre-commit hook once you have adopted it.
Part of Écrire un script bash sans copier au hasard (4 ressources gratuites) · Back to the pack