Re: fd leak with {fd}>

2012-11-27 Thread Sam Liddicott
On Tue, Nov 27, 2012 at 7:08 AM, Pierre Gaston wrote: > > > On Mon, Nov 26, 2012 at 10:48 PM, Chet Ramey wrote: > >> On 11/26/12 12:11 PM, Sam Liddicott wrote: >> > 3. there already exists simple and explicit way to get the supposed >> benefit >> > using the existing mechanism "exec" >> >> Not qu

Disabling Job Control or Enabling Minimal Config Breaks Build

2012-11-27 Thread Adam Pippin
Bash Version: 4.2 Description: I downloaded a fresh copy of bash 4.2 from the GNU project archives ( http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz), configured with: ./configure --disable-job-control --enable-minimal-config --disable-readline (Self-Serving Explanation: I'm attempting to debug

Why is not every variable initialized to its data type specific default value upon declaration in Bash?

2012-11-27 Thread Tim Friske
Hi folks, when I execute the following code in Bash version "GNU bash, version 4.1.10(4)-release (i686-pc-cygwin)", I get: declare a declare -p a # Output: -bash: declare: a: not found declare -i b declare -p b # Output: -bash: declare: b: not found declare -a c declare -p c # Output: declare -a

Re: How to initialize a read-only, global, associative array in Bash?

2012-11-27 Thread Roman Rakus
On 11/26/2012 10:45 PM, Tim Friske wrote: Hi folks, Hi I execute the following code in Bash version "GNU bash, Version 4.2.39(1)-release (x86_64-redhat-linux-gnu)": function foobar { declare -rgA FOOBAR=([foo]=bar) } foobar declare -p FOOBAR # Output: declare -Ar FOOBAR='()' I think there

Re: Why is not every variable initialized to its data type specific default value upon declaration in Bash?

2012-11-27 Thread Chet Ramey
On 11/27/12 5:03 AM, Tim Friske wrote: > Hi folks, > > when I execute the following code in Bash version "GNU bash, version > 4.1.10(4)-release (i686-pc-cygwin)", I get: > > declare a > declare -p a > # Output: -bash: declare: a: not found > declare -i b > declare -p b > # Output: -bash: declare:

Re: Disabling Job Control or Enabling Minimal Config Breaks Build

2012-11-27 Thread Chet Ramey
On 11/26/12 10:12 PM, Adam Pippin wrote: > Repeat-By: > > * Download a copy of bash 4.2. > * Configure with either or both of '--disable-job-control' and > '--enable-minimal-config'. > * Attempt to build. > > Replicated on Debian and Ubuntu. Unfortunately I don't have access to any > other famil

How to presence-detect an array variable or subscript thereof with `test -v`?

2012-11-27 Thread Tim Friske
Hi folks, I came accross the `-v` option of the `test` command and wondered how I would possibly test not only string- and integer- but also array variables as a whole and in parts. I thought it should be possible to say: declare -Ai foobar=([bar]=0) test -v foobar[foo] && echo true || echo fals

Re: How to presence-detect an array variable or subscript thereof with `test -v`?

2012-11-27 Thread Greg Wooledge
On Tue, Nov 27, 2012 at 07:57:28PM +0100, Tim Friske wrote: > I came accross the `-v` option of the `test` command and wondered how I > would possibly test not only string- and integer- but also array variables > as a whole and in parts. Sounds more like a help-bash question than a bug-bash questi

Re: How to initialize a read-only, global, associative array in Bash?

2012-11-27 Thread Chet Ramey
On 11/27/12 8:34 AM, Roman Rakus wrote: > On 11/26/2012 10:45 PM, Tim Friske wrote: >> Hi folks, > Hi >> >> I execute the following code in Bash version "GNU bash, Version >> 4.2.39(1)-release (x86_64-redhat-linux-gnu)": >> >> function foobar { >>declare -rgA FOOBAR=([foo]=bar) >> } >> foobar >

Strange re-initialization of array. Bug or feature?

2012-11-27 Thread Tim Friske
Hi folks, I execute the following code with Bash version "GNU bash, Version 4.2.39(1)-release (x86_64-redhat-linux-gnu)" on Fedora 17: # Returns 0 else 1 if the sourcing (source) script isn't keyed by its base name in the global "ONCE" array yet. # # A script should include this script near the t