Re: -e not ignored in substition under tests

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

 



Benedikt Becker <benedikt.becker@xxxxxxxx> wrote:
> Hi,
> 
> Dash does not ignore the -e option in substitutions $(...) under AND/OR lists and conditions. For example, in the program
> 
>     set -e
>     echo "$(echo X; false; echo Y)" || true
> 
> the command `false` seems to interrupt the sequence and only X is printed (tested with dash 0.5.8.2 and git master). But according to my understanding of the POSIX specifications, `set -e` should be ignored under the OR list and X and Y should be printed . The same behaviour can be
> observed when using the substitution in the condition of a while, until, and if. In contrast, set -e is effectively ignored in normal subshells under AND/OR lists and conditions (e.g., `set -e; (echo X; false; echo Y) || true` prints X and Y).
> 
> Is this a bug in dash or in my understanding?

I'd say that it's a bug.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux