home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / misc / discuss / 4596 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  1.4 KB

  1. Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!howland.reston.ans.net!paladin.american.edu!gatech!rpi!night
  2. From: night@acm.rpi.edu (Trip Martin)
  3. Newsgroups: gnu.misc.discuss
  4. Subject: Re: ftp site for the unix WHICH command
  5. Message-ID: <b2j3wlf@rpi.edu>
  6. Date: 21 Jan 93 16:54:23 GMT
  7. References: <nazari.727564365@kraft.ecn.purdue.edu>     <FRIEDMAN.93Jan20183002@nutrimat.gnu.ai.mit.edu> <BAS.93Jan21132945@carlo.phys.uva.nl>
  8. Reply-To: night@acm.rpi.edu
  9. Distribution: na
  10. Lines: 21
  11. Nntp-Posting-Host: hermes.acm.rpi.edu
  12.  
  13. In <BAS.93Jan21132945@carlo.phys.uva.nl> bas@phys.uva.nl (Bas de Bakker) writes:
  14.  
  15. >>>>>> On 20 Jan 93 18:30:02, friedman@gnu.ai.mit.edu (Noah Friedman) said:
  16.  
  17. >nf> Personally, I would advise against using `which'.  It is
  18. >nf> [t]csh-centric and does *bad* things by deliberately sourcing your
  19. >nf> .cshrc (this is a value judgement and I'm not going to waste time
  20. >nf> defending my position---just accept that I think it's bad).
  21.  
  22. >The sourcing part is horrible indeed. Nevertheless, I use 'which'
  23. >quite often as it's a zsh builtin. It simply looks in the command hash
  24. >table.
  25.  
  26. I wrote a shell function to replace the command which because the command
  27. was so slow (at least on the machines I use). Here it is for anyone that's 
  28. interested:
  29.  
  30. which() { IFS=:$IFS; for d in $PATH; do test -f $d/$1 && echo $d/$1 && break; done ;}
  31. --
  32. Trip Martin
  33. night@acm.rpi.edu
  34.