Re: bash exorcism experiment ('bug' 762923 & 763012)
- To: Russell Stuart <firstname.lastname@example.org>
- Cc: Guillem Jover <email@example.com>, firstname.lastname@example.org
- Subject: Re: bash exorcism experiment ('bug' 762923 & 763012)
- From: Stephane Chazelas <email@example.com>
- Date: Mon, 13 Oct 2014 22:14:38 +0100
- Message-id: <[🔎] 20141013211438.GD6314@chaz.gmail.com>
- In-reply-to: <firstname.lastname@example.org>
- References: <20140927153218.GB1755@nl.grid.coop> <20140927163017.GA7300@grep.be> <20140927181845.GA2816@gaara.hadrons.org> <20140927184257.GA26444@x230-buxy.home.ouaza.com> <20140928021144.GE1755@nl.grid.coop> <20140928083350.GA4738@riva.ucam.org> <email@example.com> <20140928144724.GA26933@gaara.hadrons.org> <firstname.lastname@example.org>
2014-09-29 09:22:58 +1000, Russell Stuart:
> On Sun, 2014-09-28 at 16:47 +0200, Guillem Jover wrote:
> > > I've attempted to port the many shell scripts I've written over the
> > > years to dash. The three irritants are:
> > >
> > > - pipefail,
> > <http://cfajohnson.com/shell/cus-faq-2.html#Q11>.
> That's one of those "scratch my eyes out" solutions. A more readable
> solution is just to say the exit status of each command in a temporary
> file. Given how infrequently the problem arises, it isn't a major
I happen to have written that portion of the cus FAQ. There were
a few issues with that implementation. You can find an improved
version at http://unix.stackexchange.com/a/76171/22565
> No workaround for this one? Pity. This is what usually prevents
If you do find yourself needing arrays in shells, chances are
you're not doing it the right way or that shells are not what
You may want to consider perl/ruby/python/awk instead.
Imperative programming patterns don't really apply to shells.
In any case, IMO, ksh/bash arrays are not the solution, and
there's a good reason they were never standardized by POSIX.
POSIX shells have "$@" which in most cases is more than enough.