[aklug] Re: bash die

From: Arthur Corliss <acorliss@nevaeh-linux.org>
Date: Thu Sep 16 2010 - 00:28:19 AKDT

On Wed, 15 Sep 2010, Jeremy Austin wrote:

> Chris, is checking for failure necessary in *every* step? I write
> fairly simple shell scripts, and usually check for failure in only a
> few places where it's more likely. Obviously I can't predict all the
> modes of failure, but it's more practical than checking every command.

I can't speak for Chris, but it comes down to (I imagine) whether it's a
preponderance of commands that you want to check for or not. And, of
course, how much complex logic you need to apply to program flow. Based on
his initial query, though, I imagined it would be easier to use make than
bash. I could be way off base, though.

Oh, and ignoring exit codes in make is very simple, just prefix the command
with a '-'.

> In practice I usually let cron's output be my error reporting; and if
> I want to ignore errors, there's nothing a grep and a 2>&1 won't fix.

:-) Always a good shortcut.

         --Arthur Corliss
           Live Free or Die
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Thu Sep 16 00:28:29 2010

This archive was generated by hypermail 2.1.8 : Thu Sep 16 2010 - 00:28:29 AKDT