2014-12-14 14:39:29 -0500, Chet Ramey: [...] > > ~$ bash --version > > GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) > > Copyright (C) 2013 Free Software Foundation, Inc. > > License GPLv3+: GNU GPL version 3 or later > > <http://gnu.org/licenses/gpl.html> > > > > This is free software; you are free to change and redistribute it. > > There is NO WARRANTY, to the extent permitted by law. > > ~$ b='($(uname))' bash --norc -c 'declare -a a; declare a="$b"; printf > > "<%s>\n" "$a" "${a[0]}"' > > <> > > <Linux> > > > > (on Linux Mint amd64). > > $ ./bash --version > GNU bash, version 4.3.30(15)-release (x86_64-apple-darwin13.1.0) > Copyright (C) 2013 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> > > This is free software; you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. > $ b='($(uname))' ./bash --norc -c 'declare -a a; declare a="$b"; printf > "<%s>\n" "$a" "${a[0]}"' > <Darwin> > <Darwin> [...]
Yes I don't know what Mint (Ubuntu?) did, but it's a bit broken see also: $ bash -c 'f() { declare a[1]=foo; declare -p a; }; a[0]=x; f; declare -p a' bash: line 0: declare: a: not found declare -a a='([0]="x")' (sorry about the confusion there). -- Stephane