using cd command in a file
Tom Christiansen
tchrist at convex.COM
Wed May 22 08:35:40 AEST 1991
>From the keyboard of daniel at 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 at convex.com convex!tchrist
"So much mail, so little time."
More information about the Comp.unix.questions
mailing list