[clug] finding things on the path

Michael Still mikal at stillhq.com
Wed Jan 12 00:55:28 GMT 2005


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


More information about the linux mailing list