bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

An array variable created by export/readonly builtins inside a function


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=




reply via email to

[Prev in Thread] Current Thread [Next in Thread]