Re: Exit errors by subshells are ignored in most shells

From: Stephane CHAZELAS (this.address_at_is.invalid)
Date: 06/04/04


Date: Fri, 4 Jun 2004 07:24:42 +0000

2004-06-3, 18:46(+00), Chet Ramey:
> In article <barmar-221EE3.15452802062004@comcast.dca.giganews.com>,
> Barry Margolin <barmar@alum.mit.edu> wrote:
>
>>I've always interpreted that as meaning that it won't terminate the
>>parent shell if an individual command in a complex command has a
>>non-zero termination status. But if the termination status of the
>>entire complex command is non-zero, I think the -e setting should be
>>followed.
>
> You might think that, but that's not what posix says. set -e is only
> honored for simple commands, and only in certain contexts.

Which you'd agree is nonsense, don't you? Note that it can be
interpreted other ways (see URL referenced below).

In much cases the POSIX shell specification is nonsense just
because it trys to cope with compatibility with Bourne/Korn
shell. But, here, what's the point in specifying a non-intuitive
behavior that is not even backward compatible with Bourne shell?

See:

http://groups.google.com/groups?selm=slrnb42euq.14j.stephane_chazelas%40pcchazelas.free.fr

and the whole thread.

-- 
Stephane


Relevant Pages

  • Bash-4.0 available for FTP
    ... Unlike previous bash distributions, this tar file includes the formatted ... The shell has been changed to be more ... rigorous about parsing commands inside command substitutions, ... Changes have been made to the Readline library being released at ...
    (gnu.announce)
  • Why newbies dont RTFM...
    ... Even though I've used Linux before, I've never had to do any ... BASH BUILTIN COMMANDS ... last command exited within ... unless the shell is not exeâ ...
    (comp.os.linux.misc)
  • Re: Great SWT Program
    ... None of the nasty things that you have said or implied about me are at ... treat the file as input (manually invoking the command interpreter ... script, copy the line into that within the editor, exit, and invoke ... the shell script. ...
    (comp.lang.java.programmer)
  • Re: ksh silently ignores function if mistakenly not autoloaded
    ... Here's the order of execution. ... This really takes place prior to command ... Shell scripts, with all their power, have one major drawback - they ... In the Korn Shell, there are two separate syntaxes for defining ...
    (comp.unix.shell)
  • Re: Shell function - accessing an Access secure db (.MDW file)
    ... > Hi - Does anyone know the correct syntax for the shell function. ... You can use the Shell command. ... To execute internal DOS command (Dir, Copy, ... Private Declare Function OpenProcess _ ...
    (microsoft.public.vb.general.discussion)