convoluted script causes bash to block unexpectedly

2016-06-10 Thread Iain Calder
Configuration Information [Automatically generated, do not change]: Machine: i486 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba

Re: test_v doesn't work for associative arrays

2016-06-10 Thread Chet Ramey
On 6/10/16 8:53 AM, psko...@gmail.com wrote: > Bash Version: 4.3 > Patch Level: 11 > Release Status: release > > Description: > [Detailed description of the problem, suggestion, or complaint.] > > Repeat-By: > #!/bin/bash > declare var > declare -a ary > declare -A asoc > > var=1 > ary=(1

Re: test_v doesn't work for associative arrays

2016-06-10 Thread Greg Wooledge
On Fri, Jun 10, 2016 at 02:53:23PM +0200, psko...@gmail.com wrote: > declare var > declare -a ary > declare -A asoc > > var=1 > ary=(1) > asoc[a]=1 > > for a in var ary asoc; do >printf '%s\t' "$a" >if test -v "$a"; then ... With arrays, remember that "foo" is the same as "foo[0]" in all

test_v doesn't work for associative arrays

2016-06-10 Thread pskocik
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-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKA