[zfs-discuss] zfs sysadmin notifications
omen.wild at gmail.com
Thu Apr 26 16:06:03 EDT 2012
Quoting Richard Laager <rlaager at wiktel.com> on Thu, Apr 26 14:41:
> Thanks for sharing a script with "set -u". I can't believe that I hadn't
> known of that option. I think I'm going to start using that in my
> scripts to help catch mistakes.
It's off topic, but -e is excellent too:
-e Exit immediately if a pipeline (which may consist of a single
simple command), a subshell command enclosed in parentheses, or one of
the commands executed as part of a command list enclosed by braces (see
SHELL GRAMMAR above) exits with a non-zero status.
This way if any command within a script exits with an error your
script exits too. Great for catching those mkdir's or cp's that fail. If
you know it may error you can use an '|| true', e.g.
rm $file_that_may_exist || true
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4270 bytes
Desc: not available
More information about the zfs-discuss