bug-bash
[Top][All Lists]
Advanced

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

Re: triggering of ERR trap differs between bash 3.2.39 & 4.0.28


From: Amit Dor-Shifer
Subject: Re: triggering of ERR trap differs between bash 3.2.39 & 4.0.28
Date: Mon, 09 Nov 2009 09:54:34 +0200
User-agent: Thunderbird 2.0.0.22 (X11/20090605)

Ok. Same here. (4.0.35 is not yet stable on my distro, gentoo, hence I quoted results with 4.0.28).

I'm wondering: CHANGES doesn't refer to any bug numbers or anything. Isn't bash using some issue-tracking framework?
I suppose this issue falls under:
<quote>
l. Changed behavior of shell when -e option is in effect to reflect consensus
   of Posix shell standardization working group.
</quote>

Thanks,
Amit



Chet Ramey wrote:
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.





reply via email to

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