K-shell variables & Do-loops

Dallas Braxton dallasb at ntpdvp1.UUCP
Fri Feb 9 04:40:39 AEST 1990


I'm writing a shel script using K-shell with do loops,
and I want to be able to "export" variables from the loop
to the main body. Example:

var1=yes
# ...
i=1
while i<2
do
# ...
	var1=no
	i=i+1
# ...
done
echo $var1

I get "yes".  How does one get "no"?

Dallas Braxton
Reply by e-mail to: ...!uunet!mcnc!rti!ntpdvp1!dallasb



More information about the Comp.unix.questions mailing list