Hacker News new | ask | show | jobs
by vog 3846 days ago
Note that this can be shortened to "-e" and "-u":

    #!/...
    set -eu

    # ... Main part of your script ...
1 comments

I'd used "set -e" and "set -u" before, but I had never seen it written as "-o nounset" and "-o errexit".

The latter makes it clearer exactly what features are being enabled, and it's a bit of a false economy to try and "shorten" the script like this.