home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!newsstand.cit.cornell.edu!piccolo.cit.cornell.edu!piccolo.cit.cornell.edu!ns14
- From: ns14@crux2.crux2.cit.cornell.edu (Nathan Otto Siemers)
- Subject: Re: looking a utility to chdir without typing full path
- In-Reply-To: ellis@nova.gmi.edu's message of Sun, 10 Jan 1993 15:42:54 GMT
- Message-ID: <NS14.93Jan10230841@crux2.crux2.cit.cornell.edu>
- Sender: news@piccolo.cit.cornell.edu (USENET News System)
- Nntp-Posting-Host: crux2.cit.cornell.edu
- Organization: Department of Chemistry, Cornell Univ.
- References: <1ikvt1INNqq2@usenet.INS.CWRU.Edu> <1993Jan9.005220.19993@cs.sandia.gov>
- <18350@autodesk.COM> <ellis.726680574@nova>
- Date: 10 Jan 93 23:08:41
- Lines: 46
-
- >>>>> On Sun, 10 Jan 1993 15:42:54 GMT, ellis@nova.gmi.edu (Stew Ellis) said:
-
- 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.
-
- Of course, you must be intelligent in how you name your
- directories. This is rarely a problem for me.
-
- #!/bin/csh
- #
- #
- #
- #
- #
- cd
- ls -R >! tmp23
- grep ":" tmp23 >! tmp24
- rm tmp23
- awk ' {FS =":"} {print $1} ' tmp24 >! dirlist
- awk ' BEGIN {{FS ="/"} {OFS = ""} {print "#"}} {print "alias ", $NF, " \" cd ~/", $0, " \" " }' dirlist >! ~/.alias.dirs
- rm tmp24
- rm dirlist
-
-
-
- hope it works for you.
-
-
- Nathan
-
- --
- --
- / | / /__| / /---/ /__| / | / nathan@chemres.tn.cornell.edu
-