[comp.unix.questions] variables and shells

ninja@bradley.UUCP (04/02/87)

You can't pass values of shell variables back to parent shells, but
you can redirect the input of your shell to a shell script that 
changes the value of a variable.  This is the "." command, and I think
it's documented in the SH(1) manual page.  It works something like
this :

$TERM=dumb; export TERM
$ . reset	/* reset is a shell script that contains TERM=a980 */
$echo $TERM
a980

Note that reset could contain any shell commands to change whatever
you wanted.  I'm pretty sure (but not positive) that this is how getty
runs your .profile.  A good use for this is to run a script that
recovers your terminal after a bad exit from curses.  Many uses.

And for CSH users the analogous command is "source".

Frank McGee			ihnp4!bradley!ninja