[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set -e (no || or &&)
From: |
Greg Wooledge |
Subject: |
Re: set -e (no || or &&) |
Date: |
Mon, 15 Oct 2012 08:33:46 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Sun, Oct 14, 2012 at 05:21:05PM -0700, Linda Walsh wrote:
> Steven W. Orr wrote:
> >Seriously, can we just put a trap on all messages to this list that have
> >the string 'set -e' in it? Just point the sender to a message that tells
> >them to not use it.
> ----
>
> Seriously -- why not just fix it?
Because POSIX has specified that it must be present, and that it must
work in certain ways. This is because it is a legacy feature that has
been around since the dark ages, and which all too many scripts are using
(however poorly).
My personal advice is the same as Steven's: don't use it. You're free to
take that advice, or not to take it. Chet, on the other hand, is required(*)
to implement set -e according to the ever-changing POSIX specifications,
while simultaneously trying to mimic the historical behavior of bash and
(where possible) of other Bourne/POSIX shells. It's a balancing act that
I don't envy him for having to do.
(*) "Required" insofar as he wants bash to remain POSIX compliant.