[clug] finding things on the path

Kim Holburn kim.holburn at anu.edu.au
Wed Jan 12 01:10:27 GMT 2005


# which -a '*ping*'
# sh globpath '*ping*'
ls: /usr/local/sbin/*ping*: No such file or directory
ls: /usr/local/bin/*ping*: No such file or directory
ls: /usr/bin/*ping*: No such file or directory
ls: /sbin/*ping*: No such file or directory
ls: /usr/bin/X11/*ping*: No such file or directory
/bin/ping   /usr/sbin/arping   /usr/sbin/hping
/bin/ping6  /usr/sbin/dhcping  /usr/sbin/hping2
#

which -a doesn't seem to do anything.

On 2005 Jan 12, , at 11:55 AM, Michael Still wrote:

> Kim Holburn wrote:
>> I was trying to find variants of ping on the path, like: fping and 
>> hping.  Is there a tool for this?
>> Eventually I created a little script:
>> #---------------------
>> $ more bin/globpath
>> #!/bin/sh
>> SAVEIFS="$IFS"
>> IFS=":"
>> paths=( $PATH )
>> IFS="$SAVEIFS"
>> ls ${paths[@]/%/\/$1}
>> #---------------------
>> globpath '*ping*'
>> Anyone think of a better way?
>
> which -a will do the right thing methinks.
>
> Mikal
>
> -- 
>
> Michael Still (mikal at stillhq.com) | "The geek shall inherit
> http://www.stillhq.com            |  the earth"
> UTC + 11                          |    -- The Simpsons
>
> Linux.conf.au 2005 -- Quite like an excellent Linux and Open Source
> conference. http://lca2005.linux.org.au
>
-- 
Kim Holburn
Network Manager
National Information and Communication Technology Australia
Ph: +61 2 61258620 M: +61 417820641
Email: kim.holburn at anu.edu.au  - PGP Public Key on request
Cacert Root Cert: http://www.cacert.org/index.php?id=16 -> 
http://www.cacert.org/cacert.crt
Aust. Spam Act: To stop receiving mail from me: reply and let me know.

Use ISO 8601 dates [YYYY-MM-DD] 
http://www.saqqara.demon.co.uk/datefmt.htm
Democracy imposed from without is the severest form of tyranny.
                           -- Lloyd Biggle, Jr. Analog, Apr 1961



More information about the linux mailing list