help-bash
[Top][All Lists]
Advanced

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

[Help-bash] set -e skips commands in $()


From: Sergey Fadeev
Subject: [Help-bash] set -e skips commands in $()
Date: Thu, 11 Oct 2012 11:46:16 -0400

Hi!
I have a problem with bash (4.2.24(1)-release, x86_64-redhat-linux-gnu if it matters)
When I toggle set -e option, bash obviously skips command substitutions, e.g.
$ set -e; echo $(set -e; false)
does nothing instead of closing the shell
I understand that is because set -e option only checks return values after a command has been executed and in this particular case it is echo that returns zero.
But is there a way to tell bash that I want it to check return values of command substitutions, too? I can make some changes in the source code, but I need that feature to work on multiple hosts I maintain and making changes to bash is totally not an option.
Thanks, sorry for my English

reply via email to

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