home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!UB.com!quack!dfox
- From: dfox@quack.sac.ca.us (David Fox)
- Subject: Re: looking a utility to chdir without typing full path
- Message-ID: <fXRF3m3@quack.sac.ca.us>
- Summary: use find(1)
- Organization: The Duck Pond public unix: +1 408 249 9630, log in as 'guest'.
- References: <1ikvt1INNqq2@usenet.INS.CWRU.Edu> <18350@autodesk.COM> <ellis.726680574@nova> <NS14.93Jan10230841@crux2.crux2.cit.cornell.edu>
- Date: 12 Jan 1993 06:22:44 UTC
- Lines: 36
-
- In article <NS14.93Jan10230841@crux2.crux2.cit.cornell.edu> ns14@crux2.crux2.cit.cornell.edu (Nathan Otto Siemers) writes:
- > Stew> (Wei Jin Mai) writes:
- >>
- >> I just switch to Unix from Dos. Is there a utility or shell that
- >>let you change directory without typing full path? For example: chdir
- >>abc changes working directory to /usr/local/src/abc . --
- >
- >
- > Any programmer who sees this will hate it.
- >
- > I am an organic chemist.
- >
- > This csh script creates aliases in a file .alias.dirs where
- >any directory can be cd'd to by typing it's name.
- >
- > I cron it once a day, it has worked on hpux and ultrix.
-
- An interesting solution, to be sure, but I think wasteful of disk resources.
-
- I've never done this in unix, but the approach I would take (and it would
- somewhat mirror the way I've done it with 4DOS (dos command.com replacement)
- aliases) would be to use find(1) to find every file in the system that's a
- directory, and save it to a file. This find command would be run either
- as a cron job or as part of /etc/rc.
-
- You'd also have an alias for cd that would grep the directory file, and
- execute the first line that contained the pattern for the directory you
- wanted to change to.
-
-
- >/ | / /__| / /---/ /__| / | / nathan@chemres.tn.cornell.edu
- --
- David Fox
- dfox@quack.sac.ca.us
-
-
-