Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ecr2.UUCP Path: utzoo!hcrvax!ecrhub!ecr2!peterc From: peterc@ecr2.UUCP (Peter Curran) Newsgroups: net.unix Subject: Re: Setting variables for a running process Message-ID: <129@ecr2.UUCP> Date: Mon, 27-May-85 05:16:52 EDT Article-I.D.: ecr2.129 Posted: Mon May 27 05:16:52 1985 Date-Received: Wed, 29-May-85 07:25:46 EDT References: <10893@brl-tgr.ARPA> Organization: Emerald City Research Inc., Toronto Lines: 22 Here is a scheme for getting environment changes back to your "main" shell (this works for /bin/sh. I presume masochists could find something similar in csh): Add the following three lines to your .profile file: trap '. $SHCMDS; rm -f $SHCMDS' 8 SHCMDS=$HOME/shcmds SHPID=$$ export SHCMDS SHPID Then, in suprocess, write shell commands into the file named in $SHCMDS, and send signal 8 to the process identified by $SHPID. For example, in a shell script echo "TERM=$TERM; export TERM" >$SHCMDS signal -8 $SHPID It is probably preferably that the '>' be '>>' to allow several commands to be written out at once. This will fail if you push it too hard - the shell has to get time to execute the commands before another command is issued. However, it can be used for all sorts of tricks.