summaryrefslogtreecommitdiff
path: root/examples/functions/inpath
diff options
context:
space:
mode:
Diffstat (limited to 'examples/functions/inpath')
-rw-r--r--examples/functions/inpath5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/functions/inpath b/examples/functions/inpath
index 7755b33b..cb4c93da 100644
--- a/examples/functions/inpath
+++ b/examples/functions/inpath
@@ -1,5 +1,6 @@
inpath()
{
+ local PROG
path=$(echo $PATH | sed 's/^:/.:/
s/::/:.:/g
s/:$/:./
@@ -9,7 +10,5 @@ inpath()
do
[ -x $x/$1 ] && { PROG=$x/$1; break; }
done
- [ -z "$PROG" ]
- return
+ [ -n "$PROG" ]
}
-