Bash 4.3 handles array variables in sourced scripts differently than 4.2

2014-03-09 Thread Ewan Mellor
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 version 4.3-2ubuntu1). The root of the problem is that

Re: RFE: a way to echo the arguments with quoting

2014-03-09 Thread Mike Frysinger
On Sun 02 Mar 2014 10:12:04 Andreas Schwab wrote: > Dave Yost writes: > > I have an ugly function I wrote for zsh that does this: > > > > Sat 14:17:25 ip2 yost /Users/yost > > 1 634 Z% echo-quoted xyz \$foo 'a b c ' '\n' > > xyz '$foo' 'a b c ' '\n' > > Sat 14:17:53 ip2 yost /Users/yost > > 0 63

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

2014-03-09 Thread Dan Douglas
On Fri, Mar 7, 2014 at 1:38 PM, Eduardo A. Bustamante López wrote: > WARNING: the codes given below cause the shell to enter an infinite > loop. > > > Both: > dualbus@debian:~$ bash -Tc 'f(){ :; }; trap return RETURN; f' > ^C > > and: > dualbus@debian:~$ bash -c 'f(){ trap return RETURN; }; f' > ^

Re: pattern substitution expands "~" even in quoted variables

2014-03-09 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/9/14, 3:16 AM, Mike Frysinger wrote: > On Fri 07 Mar 2014 16:15:05 Eduardo A. Bustamante López wrote: >> dualbus@debian:~$ for shell in /bin/bash ~/local/bin/bash; do "$shell" -c >> 'p=foo_bar; echo "${p/_/\~} $BASH_VERSION"'; done >> foo\~bar 4.2

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

2014-03-09 Thread Chet Ramey
On 3/7/14, 2:38 PM, Eduardo A. Bustamante López wrote: > WARNING: the codes given below cause the shell to enter an infinite > loop. > > > Both: > dualbus@debian:~$ bash -Tc 'f(){ :; }; trap return RETURN; f' > ^C > > and: > dualbus@debian:~$ bash -c 'f(){ trap return RETURN; }; f' > ^C > > Cau