Re: Problem with how to assign an array

2011-02-25 Thread Andreas Schwab
"Steven W. Orr" writes: > 517 > r=($(eval echo "\${${a_all[1]}[@]}")) If you use $(eval echo ...) you are almost always doing it wrong. eval "r=(\"\${${a_all[1]}[@]}\")" Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5

Re: bash tab variable expansion question?

2011-02-25 Thread Andreas Schwab
Eric Blake writes: > On 02/24/2011 03:14 PM, Michael Kalisz wrote: >> $ echo $PWD/ >> will expand the $PWD variable to your current directory >> >> while in bash, version 4.2.0(1)-release: >> >> $ echo $PWD/ >> will just escape the $ in front of the $ variable i.e: >> >> $ echo \$PWD/ >> The s

Re: bash tab variable expansion question?

2011-02-25 Thread Davide Brini
On Friday 25 Feb 2011 05:15:24 Eric Blake wrote: > On 02/24/2011 03:14 PM, Michael Kalisz wrote: > > $ echo $PWD/ > > will expand the $PWD variable to your current directory > > > > while in bash, version 4.2.0(1)-release: > > > > $ echo $PWD/ > > will just escape the $ in front of the $ variabl

Re: bash tab variable expansion question?

2011-02-25 Thread Clark J. Wang
On Fri, Feb 25, 2011 at 5:46 PM, Davide Brini wrote: > On Friday 25 Feb 2011 05:15:24 Eric Blake wrote: > > > On 02/24/2011 03:14 PM, Michael Kalisz wrote: > > > $ echo $PWD/ > > > will expand the $PWD variable to your current directory > > > > > > while in bash, version 4.2.0(1)-release: > > > >

Re: bash tab variable expansion question?

2011-02-25 Thread Clark J. Wang
On Fri, Feb 25, 2011 at 1:15 PM, Eric Blake wrote: > On 02/24/2011 03:14 PM, Michael Kalisz wrote: > > $ echo $PWD/ > > will expand the $PWD variable to your current directory > > > > while in bash, version 4.2.0(1)-release: > > > > $ echo $PWD/ > > will just escape the $ in front of the $ variab

Re: Problem with how to assign an array

2011-02-25 Thread Greg Wooledge
On Thu, Feb 24, 2011 at 06:59:02PM -0500, Steven W. Orr wrote: > I intentionally used the star instead of the atsign because I'm taking > advantage of the fact that these array elements all have no whitespace. So, > after the assignment to a_all, the value of a[0] is equal to the single > string

Re: bash tab variable expansion question?

2011-02-25 Thread Greg Wooledge
On Fri, Feb 25, 2011 at 09:46:58AM +, Davide Brini wrote: > Maybe, but then it shouldn't escape the $ either, as the OP is reporting for > 4.2 (I don't have a 4.2 handy to test it). I actually noticed this quite recently, but didn't think to bring it up. I had just typed some "cd" command, an

Re: bash tab variable expansion question?

2011-02-25 Thread Andreas Schwab
Greg Wooledge writes: > Fortunately the workaround was simple enough -- once the filename had > been completed I went back and x'ed out the \. Or use ~-/. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for so

Bash-4.1 Official Patch 10

2011-02-25 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.1 Patch-ID: bash41-010 Bug-Reported-by:Stephane Jourdois Bug-Reference-ID: Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-05/msg00165.ht

Re: Problem with how to assign an array

2011-02-25 Thread Steven W. Orr
On 2/25/2011 4:22 AM, Andreas Schwab wrote: "Steven W. Orr" writes: 517> r=($(eval echo "\${${a_all[1]}[@]}")) If you use $(eval echo ...) you are almost always doing it wrong. eval "r=(\"\${${a_all[1]}[@]}\")" Andreas. Thanks. I changed things of the form r=($(eval "echo "\${${a_all[

Re: bash tab variable expansion question?

2011-02-25 Thread gnu.bash.bug
Look at the following example: # touch 'file name with a space' if I press # ll file then I get: # ll file\ name\ with\ a\ space -rw-r--r-- 1 root sys 0 Feb 25 13:10 file name with a space The backslash '\' which reminds me of: # cd /tmp # mkdir hello # cd $PWD/hello W

Re: bash tab variable expansion question?

2011-02-25 Thread gnu.bash.bug
What do you mean? ~-/. is no equal to $PWD On 25 Feb, 16:03, Andreas Schwab wrote: > Greg Wooledge writes: > > Fortunately the workaround was simple enough -- once the filename had > > been completed I went back and x'ed out the \. > > Or use ~-/. > > Andreas. > > -- > Andreas Schwab, sch...@l

Re: bash tab variable expansion question?

2011-02-25 Thread Bob Proulx
gnu.bash.bug wrote: > Andreas Schwab wrote: > > Greg Wooledge wrote: > > > directory again, I typed "cd $OLDPWD/foo" -- and the $OLDPWD > > > became \$OLDPWD and did not do as I wished. > > > > Or use ~-/. > > What do you mean? > > ~-/. is no equal to $PWD No. But it is similar to $OLDPWD which