Imported from ../bash-2.0.tar.gz.
This commit is contained in:
15
examples/functions/inpath
Normal file
15
examples/functions/inpath
Normal file
@@ -0,0 +1,15 @@
|
||||
inpath()
|
||||
{
|
||||
path=$(echo $PATH | sed 's/^:/.:/
|
||||
s/::/:.:/g
|
||||
s/:$/:./
|
||||
s/:/ /g')
|
||||
|
||||
for x in $path
|
||||
do
|
||||
[ -x $x/$1 ] && { PROG=$x/$1; break; }
|
||||
done
|
||||
[ -z "$PROG" ]
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user