Export

Pete Holsberg pjh at mccc.UUCP
Mon Jul 31 02:14:46 AEST 1989


In article <13107 at bloom-beacon.MIT.EDU> scs at adam.pika.mit.edu (Steve Summit) writes:
=Note the following anomaly, which I think is implied by Chris's
=description: if a shell "imports" a variable (i.e. it had been
=exported in a parent shell), then changes its value, that changed
=value is not exported unless an explicit export is done in the
=shell within which the value is changed.  Observe:

	<Omitted: examples of "global" and "local" variables>
	
=This is a nuisance; I don't know it it's considered a "feature."
=The Korn shell (at least the old version I have) "fixes" this
=behavior: imported variables are implicitly exported.

It seems to me to be quite reasonable.  A variable defined in a subshell
(such definition occurring during an assignment) will not collide with a
global (i.e., exported) variable having the same name.  Sounds like what
is done in a couple of widely used programming languages.



-- 
Pete Holsberg -- Mercer College -- Trenton, NJ 08690
...!rutgers!princeton!njsmu!mccc!pjh



More information about the Comp.unix.wizards mailing list