2 ms·
There's a bug in his template. He suggests to `set -eu`, which is a good idea, but then immediately does this: if [[ "$1" =~ ^-*h(elp)?$ ]]; ... If the s
by Xophmeister 4y ago
There's a bug in his template.
He suggests to `set -eu`, which is a good idea, but then immediately does this:
if [[ "$1" =~ ^-*h(elp)?$ ]]; ...
If the script is given no arguments, this will exit with an unbound variable error. Instead, you want something like this:
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
- sharat87 4y agoGood catch. Fixing it.