Amit Dor-Shifer wrote:

> I've the following script:
> 
> set -eE
> on_error() { echo ERROR ERROR; }
> trap on_error ERR
> 
> if [ -n "$(echo $1 |grep a)" ];then
>    echo "input contains 'a'"
> fi
> 
> When executed under bash-4, on_error is evaluated as part of the
> expression in the 'if'. This does not happen in 3.2:

I think this is part of the new behavior of -e in bash 4. See for example 
here:

http://www.mail-archive.com/bug-bash@gnu.org/msg06288.html

Reply via email to