[aklug] Re: bash die

From: David M. Syzdek <david@syzdek.net>
Date: Wed Sep 15 2010 - 16:43:39 AKDT

Make can keep variable values across commands. Here is an example which
creates a blank file and then uses sed to replace the placeholders with
values. I'd explain it more, but I have to run.
On Wed, Sep 15, 2010 at 4:40 PM, Tim Gibney <timgibney76@gmail.com> wrote:

> Doesn't Apple have an event driven replacement for SysV scripting that is
> opensource with a Linux port? I am thinking maybe you can write several
> scripts and link them together with something event driven that calls the
> other scripts. ... ok that sounds like an ugly hack too.
>
>
> On Wed, Sep 15, 2010 at 1:16 PM, Christopher Howard <choward@indicium.us
> >wrote:
>
> > Say you have a bash script where if any command fails, the scripts
> > should stop. What would be the sensible way to deal with that?
> >
> > I was thinking, write some kind of die function, and then for each
> command:
> >
> > command_1 || die("command_1 failed")
> > mount /this/file || die("failed to mount important filesystem")
> > ...
> >
> > Or is there some better way to do this?
> >
> > --
> > Christopher Howard
> > http://frigidcode.com
> > http://theologia.indicium.us
> >
> > ---------
> > To unsubscribe, send email to <aklug-request@aklug.org>
> > with 'unsubscribe' in the message body.
> >
> >
>
>
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>
>

-- Binary/unsupported file stripped by Ecartis --
-- Type: application/octet-stream
-- File: Makefile

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Wed Sep 15 16:43:46 2010

This archive was generated by hypermail 2.1.8 : Wed Sep 15 2010 - 16:43:46 AKDT