[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -e doesn't work in subshells
From: |
Chet Ramey |
Subject: |
Re: -e doesn't work in subshells |
Date: |
Mon, 22 Jan 2001 10:31:40 -0500 |
> Machine Type: i386-suse-linux
>
> Bash Version: 2.04
> Patch Level: 0
> Release Status: release
>
> Description:
> "set -e" does not abort the entire script when used inside a
> parenthesized subshell; it only aborts the subshell.
It's not supposed to. POSIX.2 says that `set -e' causes the shell to exit
only if a simple command fails under certain circumstances (enumerated in
the bash man page). A parenthesized subshell is not a simple command.
> Repeat-By:
> trap 'echo Congratulations, your shell is not buggy' 0
You should have changed `buggy' to `POSIX conformant'.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)
Chet Ramey, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/