Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!convex!usenet From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.questions Subject: Re: using cd command in a file Message-ID: <1991May21.223540.5400@convex.com> Date: 21 May 91 22:35:40 GMT References: <1991May20.155136.25162@ux1.cso.uiuc.edu> <4076@island.COM> Sender: usenet@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 33 Nntp-Posting-Host: pixel.convex.com From the keyboard of daniel@island.COM (Daniel Smith "innovation, not litigation..."): : 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. Interesting. Another baroque (baroquen? :-) idea is to just set a variable to the name of directory. On most csh derivitives, it suffices to incant: set j=/me/A/B/C/D cd j This is nice as it also allows you to use $j for things. --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "So much mail, so little time."