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

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