|
From: | ziyunfei |
Subject: | An array variable created by export/readonly builtins inside a function becomes a locale variable to that function unexpectedly |
Date: | Sat, 28 Nov 2015 11:18:24 +0800 |
$ ksh -c 'foo() { readonly a=(1);echo a=$a; }; foo; echo a=$a' a=1 a=1 $ bash -c 'foo() { readonly a=(1);echo a=$a; }; foo; echo a=$a' # a becomes a local variable a=1 a=
[Prev in Thread] | Current Thread | [Next in Thread] |