C Shell question

HELLER%cs.umass.edu at CSNET-RELAY.arpa HELLER%cs.umass.edu at CSNET-RELAY.arpa
Wed Jul 16 05:48:15 AEST 1986


I am a very experenced VAX/VMS user, just starting to use UNIX on a SUN 3.
The SUN is running BSD 4.2 Release 3.0. I am running under the C Shell
(/bin/csh). I am trying to setup my UNIX envirement in a way simular to the
one I have evolved on the VAXen under VMS. I have a large number of
sub[-sub...]-directories on three different physical disks under VMS. In
many of these directories I have a LOGIN.COM file which sets up various
logical names (envirement variables) and symbols (aliases) peculiar to the
directory the LOGIN.COM resides in.  I have a simple DCL procedure file
which I use to change my default directory and run the LOGIN.COM in the new
directory if it exists:

$ set def 'p1'
$ l=f$search("login.com")
$ if l .eqs. "" then goto no_login
$ @login 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8'
$no_login:

I would like to do the same under UNIX.  I created a shell script like this:
(the file name is /usr/vision/heller/procs/sw.source)

cd $1
if (-e .login) then
source .login
endif

but it does not work.  When I do this:

% alias sw source /usr/vision/heller/procs/sw.source
% pwd
/usr/vision/heller
% sw procs
Terminal type is sun
% pwd
/usr/vision/heller

it just sets my default directory to my home directory and runs my main
.login file.

When I do this:

% alias sw csh /usr/vision/heller/procs/sw.source
% pwd
/usr/vision/heller
% sw procs
% pwd
/usr/vision/heller

it works, except it is done in a sub-process and my main process is not
affected.

					Robert Heller
					Heller at UMass-CS.CSNet

PS: Please reply to me directly. I am not on INFO-UNIX.  RPH



More information about the Comp.unix mailing list