[aklug] Re: bash die

From: Arthur Corliss <acorliss@nevaeh-linux.org>
Date: Wed Sep 15 2010 - 21:40:51 AKDT

On Wed, 15 Sep 2010, Jeremy Austin wrote:

> At the risk of exposing my ignorance (consider yourself flashed), is
> it too cumbersome to check exit codes? For a short script this is my
> chosen method. I don't think Chris described the size of the project,
> which would have a bearing on the scale.

Both the make & bash die() example are doing exactly that. In a nutshell,
an exit code of 0 is boolean true, and anything else is boolean false. The
question posed to all interested listeners is whether you want to use a
scripting engine like make that does this by default, or whether you want to
have to explicitly add that code *for every command* in bash.

As Chris has pointed out, though, there are trade-offs. Maintaining
internal state is significantly easier in bash than in make. Make, however,
is infinitely more pendantic about exit codes. You have to explicitly tell
make to ignore them if you want to.

         --Arthur Corliss
           Live Free or Die
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Wed Sep 15 21:40:59 2010

This archive was generated by hypermail 2.1.8 : Wed Sep 15 2010 - 21:40:59 AKDT