Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!island!daniel From: daniel@island.COM (Daniel Smith "innovation, not litigation...") Newsgroups: comp.unix.questions Subject: Re: using cd command in a file Message-ID: <4076@island.COM> Date: 21 May 91 18:26:35 GMT Article-I.D.: island.4076 References: <1991May20.155136.25162@ux1.cso.uiuc.edu> Organization: Island Graphics, Marin County, California Lines: 36 In <1991May20.155136.25162@ux1.cso.uiuc.edu> ceblair@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 may get a lot of answers telling you to make an alias so that when you type 'j', you'll go where you want. I'll propose another solution I've been using for several years. In your ~/.cshrc file, add the element "~/.dirs" to the cdpath variable. You may end up with something that looks like this: set cdpath=(. ~ .. ../.. /usr ~/.dirs) # rearrange to suit... Now, mkdir ~/.dirs, and cd into it... As for your example, you could: ln -s /me/A/B/C/D j now source your ~/.cshrc, and you should be able to "cd j" and get to where you want. The underlying idea is that you are creating a directory (~/.dirs) that potentially has a bunch of pointers (symbolic links) to places you like to go to frequently. For instance, I "cd ulb" to go to /usr/local/bin, "cd ubx" to go to /usr/bin/X11, and so on. Daniel -- daniel@island.com Daniel Smith, Island Graphics, (415) 491 0765 x 250(w) daniel@world.std.com 4000 CivicCenterDrive SanRafael MarinCounty CA 94903 dansmith@well.sf.ca.us Fax: 491 0402 Disclaimer: Hey, I wrote it, not IG! falling/yes I'm falling/and she keeps calling/me back again - IJSaF, Beatles