bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: backquotes inconsistent with errexit (set -e) and export


From: Paul Jarc
Subject: Re: backquotes inconsistent with errexit (set -e) and export
Date: Thu, 24 Jun 2004 01:31:53 -0400
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

Hans Ecke <address@hidden> wrote:
>         However, using the 'export' builtin will disable this behavior:
>            set -e;export VVV=`false`
>         will not stop the script.

That's because the export command's exit status is 0, regardless of
what happens while computing its arguments.  This is not the only case
where -e doesn't mean what we might wish it to mean - a subshell like
(false) also will not cause the script to exit.  But this is how it's
specified, and it's not going to change.

Also, -e means subtly different things in different sh
implementations, so it's more trouble than it's worth for portable
scripting.  I've given up and switched to inserting "&&" everywhere.


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]