On 12/3/16 10:26 PM, Laur Aliste wrote: > Hi, > upgraded bash from > GNU bash, version *4.3.30(1)-release* (x86_64-pc-linux-gnu) > to *4.4.5(1)-release* and noticed the *readonly* array variables fail to be > defined with init values.
This was changed as the result of a bug report from December, 2015: http://lists.gnu.org/archive/html/bug-bash/2015-11/msg00140.html `readonly' and `export' create global variables by default. They're Posix builtins, and that's how Posix works (and other shells, like ksh93). There was an inconsistency in how they treated array declarations, and that's what the change addressed. If you want i and j to be treated as array variables, declare them as array variables. Something like o() { declare -ar i=($1) declare -ar j=(1 2 3) [and so on...] } Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/