Shell variables - help

Bob McGowen x4312 dept208 bob at wyse.wyse.com
Thu Oct 11 07:35:30 AEST 1990


In article <1339 at ul-cs.ulowell.edu> mchetan at hawk.ulowell.edu (Munisuvratha Chetan) writes:
>I have a shell program that sets certain shell variables
>according to certain working environment.  If I execute this
....
>How do I tell the current shell to execute the shell program in
>the current shell, and NOT in a new shell ?

try using the dot command in sh or source in csh:

For sh:
   . file # the current shell reads file and runs it,
	  # file need not be executable

For csh:
   source file # current shell read and runs file,
	       # also does not need execut permissions

In sh (maybe also csh, I do not know), if you are running as root and
the root path does not inlcude the current directory (which is good
security practice), you will need to use the dot command as follows:

   . ./file # provides a relative path pointed at the file

Bob McGowan  (standard disclaimer, these are my own ...)
Product Support, Wyse Technology, San Jose, CA
..!uunet!wyse!bob
bob at wyse.com



More information about the Comp.unix.questions mailing list