I dont want to call the second script from the first with the variables on
the 'command l
I really want to set an environment variable in script1 and pick it up in
script2, but I can't get it to work
script1=
-----------------------------------------------
dk=derrick
echo $dk
script2
-----------------------------------------------
script2 =
-----------------------------------------------
echo $dk
script 1 echos derrick, but script 2 does not??
thanks
derrick
If script 1 calls script 2, then add "export dk" and it will work.
If script 1 does not call script 2 (i.e., they're both called by some
other process, and neither calls the other, or script 2 calls script
1), then it cannot be done.
--
James Carlson, KISS Network <james.d...@sun.com>
Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
> If script 1 does not call script 2 (i.e., they're both called by some
> other process, and neither calls the other, or script 2 calls script
> 1), then it cannot be done.
You could kluge something similar by having some temp file that script 1
writes, and then script 2 reads it and puts it into its envvar.
--
Frank J. Perricone fr...@dlc.state.vt.us
IT Manager 802-828-4926 Fax: 802-828-2803
Vermont Department of Liquor Control http://www.state.vt.us/dlc/
e.g
myvar2="Joe Blow"
export myvar2
./script2
----- script2
echo "Who is $myvar2"
*** this is bourne shell