[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set -e is ineffective for subshells
From: |
Paul Jarc |
Subject: |
Re: set -e is ineffective for subshells |
Date: |
Tue, 16 Oct 2001 15:09:08 -0400 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7 |
Chet Ramey <chet@nike.ins.cwru.edu> wrote:
>> Repeat-By:
>> bash -e '(exit 1); echo still here'
>
> POSIX.2 says that `set -e' causes the shell to exit if a simple
> command fails (subject to a few irrelevant conditions). A subshell
> like `(exit 1)' is not a simple command.
This behavior is incomatible with traditional sh, and it makes it
harder to write correct, portable #!/bin/sh scripts. Does POSIX
prohibit exiting in this case, or merely not require it?
paul