bug-bash
[Top][All Lists]
Advanced

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

variables set on command line


From: Sam Steingold
Subject: variables set on command line
Date: Wed, 24 Aug 2011 11:24:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

CYGWIN_NT-5.2-WOW64 sds 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin
BASH_VERSION='4.1.10(4)-release'

at the bash prompt I observe this:
$ f(){ echo a=$a b=$b c=$c ; }
$ unset a b c
$ a=a b=b f
a=a b=b c=
$ f
a= b= c=
which I believe is correct (i.e., variables set in "a=a b=b f" are unset
after f terminates).

alas, when I call /bin/sh on the same machine, I see this:

f(){ echo a=$a b=$b c=$c ; }
f
a= b= c=
a=a b=b f
a=a b=b c=
f
a=a b=b c=
exit

i.e., variables set in "a=a b=b f" survive to the next command.
$ /bin/sh --version
GNU bash, version 4.1.10(4)-release (i686-pc-cygwin)

is this the expected behavior?

thanks.

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://palestinefacts.org http://openvotingconsortium.org http://memri.org
http://www.PetitionOnline.com/tap12009/ http://dhimmi.com
He who laughs last thinks slowest.




reply via email to

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