The first two statements of your BASH script should be…

Mh… je ne connaissais pas cette astuce.

Juste après le « shebang », mettre ça sur la ligne d’après :

set -euo pipefail
“set -e” which ensures that your script stops on first command failure.
“set -u” which ensures that your script exits on the first unset variable encountered.
“set -o pipefail” which ensures that if any command in a set of piped commands failed, the overall exit status is the status of the failed command.

#19394  

https://ashishb.net/all/the-first-two-statements-of-your-bash-script-should-be/