repo.or.cz
/
bash.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Patch-ID: bash41-003
[bash.git]
/
examples
/
functions
/
inpath
blob
cb4c93da336d2dfc9206f3ebe3316badb11ecba7
1
inpath()
2
{
3
local PROG
4
path=$(echo $PATH | sed 's/^:/.:/
5
s/::/:.:/g
6
s/:$/:./
7
s/:/ /g')
8
9
for x in $path
10
do
11
[ -x $x/$1 ] && { PROG=$x/$1; break; }
12
done
13
[ -n "$PROG" ]
14
}