Amit Dor-Shifer wrote:
cm.stargate ~ # bash -xc 'set -eE;on_error() { echo ERROR ERROR; };trap
on_error ERR;if [ -n "$(echo $0 |grep a)" ];then echo "input contains
'a'";fi' b
+ set -eE
+ trap on_error ERR
++ echo b
++ grep a
+++ on_error
+++ echo ERROR ERROR
+ '[' -n 'ERROR ERROR' ']'
+ echo 'input contains a'
input contains a
</bash-4>
I can't reproduce it with bash-4.0.35:
$ ../bash-4.0-patched/bash -xc 'set -eE;on_error() { echo ERROR ERROR;
};trap on_error ERR;if [ -n "$(echo $0 |grep a)" ];then echo "input
contains 'a'";fi' b
+ set -eE
+ trap on_error ERR
++ echo b
++ grep a
+ '[' -n '' ']'
$ ../bash-4.0-patched/bash --version
GNU bash, version 4.0.35(9)-release (i386-apple-darwin10.0.0)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.