home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso / altsrc / articles / 10833 < prev    next >
Text File  |  1994-07-11  |  824b  |  24 lines

  1. Newsgroups: alt.sources
  2. Path: wupost!math.ohio-state.edu!cs.utexas.edu!utnut!utzoo!telly!problem!vigard!mdf
  3. From: mdf@vigard.mef.org (Matthew Francey)
  4. Subject: Re: Source to a simple which command (C program source)
  5. References: <1994Jul8.104300.16682@walter.cray.com>
  6. Organization: The International Bank of Intermod
  7. Date: Sun, 10 Jul 1994 00:41:28 GMT
  8. Message-ID: <1994Jul10.004128.25426@vigard.mef.org>
  9. Lines: 13
  10.  
  11. jwl@dogwood.cray.com (James W. Lynch) writes:
  12. >I noticed a discussion recently that suggested that everyone didn't
  13. >have a which command.
  14.  
  15. IFS=" \011\012:"
  16. for i in $*; do
  17.     for j in $PATH; do
  18.         [ -x $j/$i ] && { echo $j/$i; break; }
  19.     done
  20. done
  21. -- 
  22. Matthew Francey                     mdf@vigard.mef.org            ve3rqx@io.org
  23. "live before you die"               GPS(NAD27): N43o34.210' W079o34.563' +0093m
  24.