Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!think.com!yale!venus!yalevm!schdavz From: SCHDAVZ@YaleVM.YCC.Yale.Edu (Dave Schweisguth) Newsgroups: comp.unix.questions Subject: Re: using cd command in a file Message-ID: <91145.110241SCHDAVZ@YaleVM.YCC.Yale.Edu> Date: 25 May 91 15:02:41 GMT Organization: Yale University Lines: 23 >muquit@garfield.ncat.edu (MUHAMMAD A. MUQUIT) writes: >>In article <1991May20.155136.25162@ux1.cso.uiuc.edu> Charles Blair writes: >>> I would like to get to a directory /me/A/B/C/D by just typing j. I tried >>>creating a file j with cd /me/etc in it, then chmod +x j. It didn't work. >>>Thanks in advance. I'm sure I'm overlooking something well-known. >> >>You can do the job if you put this line in your .login file: >> alias j 'cd /me/A/B/C/D' >>I'm also curious why your way didn't work. I think there're lots of gurus >>out there to answer this. > > Alias is definitely the way to go here. As to why the script-file >solution did not work: Whenever you invoke a script-file, it creates its >own shell. Within this shell, it cd's to the right directory, but then >the script-file process terminates and your shell is still sitting right >where it was before. But 'source' in csh stays in the same shell and needn't be 'chmod'ed, yes? _____________________________________________________________________________ / \ | Dave Schweisguth 5386 Yale Station 203-436-2694 | | schdavz@yalevm.ycc.yale.edu New Haven, CT 06502-5386 | \_____________________________________________________________________________/