bug-bash
[Top][All Lists]
Advanced

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

Re: feature request: more complete set -e


From: Chet Ramey
Subject: Re: feature request: more complete set -e
Date: Thu, 25 Jun 2009 19:33:18 -0400
User-agent: Thunderbird 2.0.0.22 (Macintosh/20090605)

Marc Weber wrote:

> This is my point: I'd like to tell bash: Whenever running an executable
> assume that if it returns a non zero exit status that's a unforeseen
> exception. And in this case don't continue as usual but abort and return
> non zero exit status yourself. set -e comes close.

You're talking about making bash exit when a command fails even when
not in a command execution context.  The example above is a word
expansion context.  `set -e' acts in a command execution context.

Nor are you talking only about executables; you mean builtins too,
just to make that clear.

Your proposal would have bash exit on

echo `expr $var - 1`

if `var' happened to be 1.  (That construct is very common in older shell
code.)

I don't think that extension would be useful enough to be worth the
effort.

Chet


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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