chiark / gitweb /
test -f for */* too
authorColin Watson <cjwatson@chiark.greenend.org.uk>
Sat, 7 Apr 2007 13:08:13 +0000 (13:08 +0000)
committerColin Watson <cjwatson@chiark.greenend.org.uk>
Sat, 7 Apr 2007 13:08:13 +0000 (13:08 +0000)
pwhich

diff --git a/pwhich b/pwhich
index ebb54c3..262dc83 100755 (executable)
--- a/pwhich
+++ b/pwhich
@@ -7,7 +7,7 @@ for PROGRAM in "$@"; do
  IFS=:
  case $PROGRAM in
   */*)
-   if [ -x "$PROGRAM" ]; then
+   if [ -f "$PROGRAM" ] && [ -x "$PROGRAM" ]; then
     printf '%s\n' "$PROGRAM"
     RET=0
    fi