Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!sdd.hp.com!swrinde!elroy.jpl.nasa.gov!thyme!kaleb From: kaleb@thyme.jpl.nasa.gov (Kaleb Keithley) Newsgroups: comp.unix.questions Subject: Re: using cd command in a file Message-ID: <1991May20.223207.25210@thyme.jpl.nasa.gov> Date: 20 May 91 22:32:07 GMT References: <1991May20.201923.27920@garfield.ncat.edu> Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 24 In article muquit@garfield.ncat.edu (MUHAMMAD A. MUQUIT) writes: >In article 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 are lots of gurus >out there to answer this. I'm not a guru, but if you consider that the shell that is running the script is a different shell than the one you are typing from. The shell that is running the script changes directories, and then exits, returning you to your original shell, which, BTW, never changed directories. -- Kaleb Keithley kaleb@thyme.jpl.nasa.gov Meep Meep Roadrunner Veep veep Quayle