On Thu, Jul 31, 2014 at 07:51:01AM -0700, Linda Walsh wrote: > Chet Ramey wrote: > >$ ./bash ./x24 > >4.2.47(4)-release > >foo = one > >foo = two > >$ cat ./x24 > >echo $BASH_VERSION > > > >foo=one > >readonly foo > >export foo > > > >./bash -c 'echo foo = $foo ; foo=two ; echo foo = $foo' > > When did that change?
You might be confusing subshells with explicit new process creation. Attributes like readonly are not passed through the environment. How could they be? What out-of-band facility is available to mark environment variables as having these attributes? imadev:~$ cat ./x24 echo "$BASH_VERSION" foo=one readonly foo export foo bash-2.05b -c 'echo "foo=<$foo>"; foo=two; echo "foo=<$foo>"' imadev:~$ bash-2.05b ./x24 2.05b.0(2)-release foo=<one> foo=<two>