Path: utzoo!attcan!uunet!samsung!sdd.hp.com!usc!rutgers!mcnc!rti!dg-rtp!hunt From: hunt@dg-rtp.rtp.dg.com (Greg Hunt) Newsgroups: comp.unix.questions Subject: Re: Shell variables - help Message-ID: <1990Oct10.160454.586@dg-rtp.dg.com> Date: 10 Oct 90 16:04:54 GMT References: <1339@ul-cs.ulowell.edu> Sender: usenet@dg-rtp.dg.com (Usenet Administration) Reply-To: hunt@dg-rtp.rtp.dg.com Organization: Data General Corp., Research Triangle Park, NC Lines: 36 In article <1339@ul-cs.ulowell.edu>, mchetan@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 > program after logging in, the login shell does not have those > variables (of course, because the shell program is executed in > a new shell). > How do I tell the current shell to execute the shell program in > the current shell, and NOT in a new shell ? > Or, isn't there any such mechanism ? > > Thanx a bunch. > If the script is a bourne shell script (designed for /bin/sh), then you do the following: . name_of_script This is a period followed by a space followed by the name of your script. If the script is a C shell script (designed for /bin/csh), then you do the following: source name_of_script I don't know how other shells (like ksh) handle this. Enjoy! -- Greg Hunt Internet: hunt@dg-rtp.rtp.dg.com DG/UX Kernel Development UUCP: {world}!mcnc!rti!dg-rtp!hunt Data General Corporation Research Triangle Park, NC These opinions are mine, not DG's.