Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!uhura.cc.rochester.edu!uhura!saaf
From: saaf@joker.optics.rochester.edu (Lenny Saaf)
Newsgroups: comp.unix.questions
Subject: csh setenv problem
Message-ID: 
Date: 16 Aug 89 19:39:40 GMT
Sender: news@uhura.cc.rochester.edu
Organization: The Institute of Optics, University of Rochester
Lines: 30

I want to execute a csh script and set some variables for use in the
parent shell.  As I understand it, the script in the file is executed
in a subshell, so I think I have to "export" any csh variables I set
in the shell script.  That is, use setenv as opposed to set.  Well, I
can't seem to get it to work.  The shell script file looks like this:

# csh script
# filename is testscript
setenv FOO 'bar'
echo $FOO
# end

The result:

[1]% chmod +x testscript
[2]% testscript
bar
[3]% echo $FOO
FOO: Undefined variable.



What am I missing?

Related flame: HP's C shell documentation is lame.

--
* Len Saaf,  The Institute of Optics, University of Rochester,  Rochester, NY *
* Internet: saaf@joker.optics.rochester.edu  Bitnet: SAAF@UOROPT  Radio: NV2Z *
* Internet (last resort): saaf%joker.optics.rochester.edu@vm.cc.rochester.edu *