Shell Script Question

Bill Davidson harley7
Thu Jun 2 17:17:46 PDT 2005


On 14:17 Thu 02 Jun     , Mike Reinehr wrote:
> Brad,
> 
> Your scripting skills appear to be far past mine, but my experience with sh 
> has been that all variables are global. I just ran a quick test of a script 
> similar to yours and, in fact, they were. A couple of differences that might 
> be significant:
> 
> I initialized my variables the old fashioned way:
> 
> export TEMP=0 TEMP1=1 TEMP2=2

The export statement makes those variables available anywhere in the shell session.
If you spawned another sub-shell within that one, they would be available
there as well.

Bill


More information about the Linux-users mailing list