home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / question / 15401 < prev    next >
Encoding:
Text File  |  1993-01-11  |  1.7 KB  |  61 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!newsstand.cit.cornell.edu!piccolo.cit.cornell.edu!piccolo.cit.cornell.edu!ns14
  3. From: ns14@crux2.crux2.cit.cornell.edu (Nathan Otto Siemers)
  4. Subject: Re: looking a utility to chdir without typing full path
  5. In-Reply-To: ellis@nova.gmi.edu's message of Sun, 10 Jan 1993 15:42:54 GMT
  6. Message-ID: <NS14.93Jan10230841@crux2.crux2.cit.cornell.edu>
  7. Sender: news@piccolo.cit.cornell.edu (USENET News System)
  8. Nntp-Posting-Host: crux2.cit.cornell.edu
  9. Organization: Department of Chemistry, Cornell Univ.
  10. References: <1ikvt1INNqq2@usenet.INS.CWRU.Edu> <1993Jan9.005220.19993@cs.sandia.gov>
  11.     <18350@autodesk.COM> <ellis.726680574@nova>
  12. Date: 10 Jan 93 23:08:41
  13. Lines: 46
  14.  
  15. >>>>> On Sun, 10 Jan 1993 15:42:54 GMT, ellis@nova.gmi.edu (Stew Ellis) said:
  16.  
  17.  Stew> (Wei Jin Mai) writes:
  18. >
  19. >    I just switch to Unix from Dos. Is there a utility or shell that
  20. >let you change directory without typing full path? For example: chdir
  21. >abc changes working directory to /usr/local/src/abc .  --
  22.  
  23.  
  24.     Any programmer who sees this will hate it.
  25.  
  26.     I am an organic chemist.
  27.  
  28.     This csh script creates aliases in a file .alias.dirs  where
  29. any directory can be cd'd to by typing it's name.
  30.  
  31.     I cron it once a day, it has worked on hpux and ultrix.
  32.  
  33.     Of course, you must be intelligent in how you name your
  34. directories.  This is rarely a problem for me.
  35.  
  36. #!/bin/csh
  37. #
  38. #
  39. #
  40. #
  41. #
  42. cd 
  43. ls -R >! tmp23
  44. grep ":" tmp23 >! tmp24
  45. rm tmp23
  46. awk ' {FS =":"} {print $1} ' tmp24 >! dirlist
  47. awk ' BEGIN {{FS ="/"} {OFS = ""} {print "#"}} {print "alias ", $NF, "  \" cd  ~/", $0, "  \" " }' dirlist  >!  ~/.alias.dirs
  48. rm tmp24
  49. rm dirlist
  50.  
  51.  
  52.  
  53. hope it works for you.
  54.  
  55.  
  56.  Nathan
  57.  
  58. --
  59. --
  60. /  | / /__|  /  /---/ /__| /  | /    nathan@chemres.tn.cornell.edu
  61.