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