🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.linux
Article #47041

Re: Where do I get the "which" command?

#47041
From: Raj
Date: Wed, 20 Jan 1999 00:00
47 lines
2121 bytes
Put the following in a file called 'which', make it
an executeable and make sure the directory is
always in your path.

(All credits to whoever wrote it first)
--------------------------------------------------------------------------
#!/bin/sh
set -u
fCmd=`/bin/basename $0`
if [ $# -lt 1 ]
then
    echo "usage: ${fCmd} <command>"
    exit 1
fi

lPath=`echo $PATH | /bin/sed -e 's/:/ /g'`

for lDir in ${lPath}
do
    if [ -x "${lDir}/$1" ]
    then
        echo "${lDir}/$1"
        if [ "${fCmd}" = "which" ]
        then
            break
        fi
    fi
done
exit 0
----------------------------------------------------------------------------

In article <36a1b5e9.0@news.chariot.net.au>, mtw@calypso.view.net.au (Michael 
Talbot-Wilson) wrote:
::>>On Fri, 8 Jan 1999 13:04:59 +1100, "Phill Edwards"
::>><phill_edwards@hotmail.com> wrote:
::>>
::>>>When I try to "make xconfig", it gets part way through and then falls over
::>>>beceause it says it doesn't know what the "which" command is.
::>>>
::>>>I'm running Debian Linux 2.0.34. Does anyone know what package I need to
::>>>implement "which"?
::>>>Thanks,
::>
::>Dunno if you ever got a serious answer -- haven't specifically checked,
::>but the package is probably file-utils.  It's not Debian-specific.  Or
::>even Linux-specific.
::>
Technical Details
Message-ID: <916788014.312954@happy.isa.nec.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <773ove$o95$1@reader1.reader.news.ozemail.net> <3698d1d7.35116110@news.discover-net.net> <36a1b5e9.0@news.chariot.net.au>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 102983,330347e518ef479a
X-Google-Attributes: gid102983,public
From: NOSPAM.rt_1998@hotmail.com (Raj)
Subject: Re: Where do I get the "which" command?
Date: 1999/01/20
Message-ID: <916788014.312954@happy.isa.nec.com.au>
X-Deja-AN: 434590777
Cache-Post-Path: frodo.nec.com.au!unknown@happy.isa.nec.com.au
References: <773ove$o95$1@reader1.reader.news.ozemail.net> <3698d1d7.35116110@news.discover-net.net> <36a1b5e9.0@news.chariot.net.au>
X-Trace: news.mel.aone.net.au 916788014 3139 147.76.180.5 (19 Jan 1999 23:20:14 GMT)
Organization: Remove "NOSPAM." B4 Replying
X-Cache: nntpcache 2.3.2.1 (see http://www.nntpcache.org/)
NNTP-Posting-Date: 19 Jan 1999 23:20:14 GMT
Newsgroups: aus.computers.linux