re: Handling Arguments in Bash Scripts VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Very nice article but I would like to suggest you another approach to deal with missing arguments... Don't allow variables not set: #!/bin/bash...
 

What other options of set are typically used in bash scripts?

 

Usually I see set -o errexit, set -o nounset, and set -o pipefail as safety catches. Ben is right on about set -x. That’s a great one for debugging. Googling or running ‘man set’ will give you a bunch more info :)

 

-x prints out every command as it's run, which can be fun (if verbose) for debugging.

code of conduct - report abuse