Re: nameref bug?

2014-09-02 Thread Greg Wooledge
On Wed, Sep 03, 2014 at 02:18:25AM +0800, lolilolicon wrote: > Indeed this seems worth adding to the Greg's Wiki! There is a *tiny* bit already written on this topic, but it's hidden deep inside FAQ 048: http://mywiki.wooledge.org/BashFAQ/048#The_problem_with_bash.27s_name_references Ormaaj also

"source" cmd creates entry in BASH_SOURCE etc. only if within function

2014-09-02 Thread jim . avera
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share

Re: nameref bug?

2014-09-02 Thread lolilolicon
On Tue, Sep 2, 2014 at 8:59 PM, Greg Wooledge wrote: > On Sat, Aug 30, 2014 at 12:02:33PM +0800, lolilolicon wrote: >> > #!/bin/bash >> > declare var="hello world" >> > declare -n ref >> > ref=var >> > echo $ref >> > ref=var >> > echo $ref >> > >> > --- output --- >> > hello world >> > var > >> Ah

Re: umask --help

2014-09-02 Thread Chet Ramey
On 9/2/14, 5:37 AM, Notes Jonny wrote: > Hi Guys > > Any update on implementing this? I haven't done anything with this yet. If and when it happens, it will show up in the devel git branch on savannah. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars

Re: Difference between assignment via nameref vs `printf -v`?

2014-09-02 Thread Chet Ramey
On 9/1/14, 10:16 PM, lolilolicon wrote: > On Tue, Sep 2, 2014 at 9:02 AM, Chet Ramey wrote: >> It's a bug that results in `arr[0]' being created as a shell variable. >> I've attached a patch for people who want to experiment with it. > > I applied it against 4.3.24 but it failed to build... Am I

Re: nameref bug?

2014-09-02 Thread Greg Wooledge
On Sat, Aug 30, 2014 at 12:02:33PM +0800, lolilolicon wrote: > > #!/bin/bash > > declare var="hello world" > > declare -n ref > > ref=var > > echo $ref > > ref=var > > echo $ref > > > > --- output --- > > hello world > > var > Ah, LOL I think I need some sleep. This is not a bug. Sorry for all the

Re: umask --help

2014-09-02 Thread Notes Jonny
On Thu, Jul 31, 2014 at 11:18 AM, Pádraig Brady wrote: > On 07/30/2014 07:48 PM, Chet Ramey wrote: >> On 7/30/14, 2:44 PM, Notes Jonny wrote: >>> On 7 Jul 2014 19:47, "Eric Blake" wrote: On 07/07/2014 12:34 PM, Chris Down wrote: > Hi Jon, > > As is standard with other buitin