[u-u] Sams book

D. Hugh Redelmeier hugh at mimosa.com
Fri Jan 15 14:58:20 EST 2016


| From: Vance Shipley <vances at motivity.ca>

| On Fri, Jan 15, 2016 at 9:08 PM, Jim Mercer <jim at reptiles.org> wrote:
| > if your shell scripting depends on new features, you are doing it wrong.

Mostly I agree.

There's a pair of bash features I try to recommend to everyone for
most scripts:

	set -eu

The -e means "stop on error returns".  This is very good at exposing
problems that are otherwise silent.

The -u means that a reference to an undefined variable is an error.
So misspellings don't slip through.

Using -e isn't fun for an interactive shell!

| As a rue of thumb I would agree.

I love that (Freudian?) slip.  I often rue what my thumb types.



More information about the u-u mailing list