
exporting C shell variable
On Fri, 17 Oct 1997 22:02:43 GMT, Terrance
: #!/bin/sh
: ...something in bourne
: /bin/csh cscript #including variables (eg a = 1, b = 2)
: ...reads $a and $b
The child process inherits the envirnoment of its parrent;
NOT the other way around, so the answer is no.
However if you want to export env from csh, you set the env var
with setenv:
setenv <variablename> <value>
(RTFM)
and the env will be inherited by any sh started from your csh session.
: +... would the /bin/csh supposedly read the .login or .cshrc files?
only .cshrc. RTFM
Possibly, you might want to try this (I haven't :-):
eval `( cat cscript; echo env ) | /bin/csh`
and then export the env var's you need using sh export,
or export automatically using a temp file and awk...
--
:-- Hans Georg --- student of 'Life, the Universe and Everything'
<ge...@ii.uib.no> (stud.oecon. stud.scient.) http://www.ii.uib.no/~georg/