Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!ukc!dcl-cs!gdt!gdr!exspes From: exspes@gdr.bath.ac.uk (P E Smee) Newsgroups: comp.unix.questions Subject: Re: export vars from cshell script? Message-ID: <1989Nov16.110451.10002@gdt.bath.ac.uk> Date: 16 Nov 89 11:04:51 GMT References: <1815@gazette.bcm.tmc.edu> Reply-To: exspes@gdr.bath.ac.uk (P E Smee) Organization: University of Bristol c/o University of Bath Lines: 27 In article <1815@gazette.bcm.tmc.edu> heidi@kiwi.bcm.tmc.edu (Heidi Johnson) writes: >Is there an equivalent in the Cshell to the Bourne shell's export >facility? We have would like to define new environment variables in a >shell, and have them be known to subsequent processes. > >We're using SunOS 4.0. Use setenv. (See csh(1)). Variables defined using setenv are available in child processes. The syntax of setenv is different from set, God only knows why. Look also at the 'Variable substitutions' section in csh(1), as there are limitations on the use of : modifiers if a variable is an environment var rather than a shell (set) var. If you have the same name both 'set' and 'setenv'ed in a process, the 'set' definition should win. (So, if you need to use : modifiers on env'ed vars, you need to arrange for the child process to do something like: set fred $fred (Assuming fred is not already 'set', the 'setenv' value will be picked up.) -- Paul Smee | JANET: Smee@uk.ac.bristol Computer Centre | BITNET: Smee%uk.ac.bristol@ukacrl.bitnet University of Bristol | Internet: Smee%uk.ac.bristol@nsfnet-relay.ac.uk (Phone: +44 272 303132) | UUCP: ...!uunet!ukc!gdr.bath.ac.uk!exspes