Re: set -e loses exit status

2014-03-10 Thread Dennis Lambe Jr.
Quoting Chet Ramey : I will change back to the pre-bash-4.1 behavior for the next version. That's fantastic. Thank you! There really isn't any requirement other than the exit status be non-zero Since I bothered to dig through the standard, I'll document what I found here in case it's use

Some bugs in bash detected by cppcheck, splint and our own tool

2014-03-10 Thread flaviomotamedeiros
We have analyzed the bash source code using tools, such as cppcheck, splint and our own tool, and foound the following possible problems. FILE: bash/lib/readline/input.c/v1-input.c LINE: 267 MSG: Uninitialized variable: input CONFIG: !O_NDELAY FILE: bash/lib/sh/strftime.c/v1-strftim

Re: set -e loses exit status

2014-03-10 Thread Chet Ramey
On 3/10/14, 2:32 PM, Dennis Lambe Jr. wrote: > When set -e is in effect in a subshell, the exit status of commands, > functions, and sub-subshells is converted to 1. Thanks for the report. There really isn't any requirement other than the exit status be non-zero, but I will change back to the pre

>| expansion assumes | rules instead of > rules

2014-03-10 Thread 積丹尼 Dan Jacobson
# su - nobody #create pristine bug testing environment $ : >| /tmp/ shows much less choices than $ : > /tmp/ It is probably wrongly assuming we want to see the $ : | /tmp/ choices! BASH_VERSION='4.3.0(1)-release' $ apt-cache policy bash-completion bash-completion: Installed: (none)

set -e loses exit status

2014-03-10 Thread Dennis Lambe Jr.
When set -e is in effect in a subshell, the exit status of commands, functions, and sub-subshells is converted to 1. $ ( ( exit 75 ) ); echo $? 75 $ (set -e; ( exit 75 ) ); exit $? 1 Versions of bash prior to 4.1 didn't convert all exit statuses to 1 when set -e was in effect. $ uname -a L

Re: Bash 4.3 handles array variables in sourced scripts differently than 4.2

2014-03-10 Thread Ewan Mellor
On 3/10/14, 6:50 AM, "Chet Ramey" wrote: >On 3/9/14 8:45 PM, Ewan Mellor wrote: >> Hi, >> >> Please cc me ‹ I¹m not subscribed to this list. >> >> I have a script that works correctly in Bash 4.2.25(1)-release from >>Ubuntu >> 12.04 (package version 4.2-2ubuntu2) but that fails in Bash >> 4.3.0

Bash does not follow POSIX when return is called during the action of a trap

2014-03-10 Thread Eduardo A . Bustamante López
According to POSIX: | The value of the special parameter '?' shall be set to n, an | unsigned decimal integer, or to the exit status of the last command | executed if n is not specified. If the value of n is greater than | 255, the results are undefined. When return is executed in a trap | action,

Re: Bash 4.3 handles array variables in sourced scripts differently than 4.2

2014-03-10 Thread Chet Ramey
On 3/9/14 8:45 PM, Ewan Mellor wrote: > Hi, > > Please cc me ‹ I¹m not subscribed to this list. > > I have a script that works correctly in Bash 4.2.25(1)-release from Ubuntu > 12.04 (package version 4.2-2ubuntu2) but that fails in Bash > 4.3.0(1)-release from Ubuntu 14.04 prerelease (package ver

Re: Executing 'return' inside RETURN trap causes function to recurse infinitely

2014-03-10 Thread Eduardo A . Bustamante López
> While it was clearly not the original intention of the code, the current > behavior has been in place for many years. I know how to change it if > and when I want, but for now I will leave it alone. > > Chet I don't see any problem with keeping the current behavior (since it's been like that fo

Re: Executing 'return' inside RETURN trap causes function to recurse infinitely

2014-03-10 Thread Chet Ramey
On 3/9/14 2:57 PM, Dan Douglas wrote: >> Cause the function call to recurse infinitely. I would understand if >> this is labeled as a feature, rather than a bug (in the sense that >> the user shouldn't be putting return inside a return trap :), so one >> can safely assume that if they did it, it's