chiark / gitweb /
pwhich: Portability fix, picked up by 'posh'.
authorColin Watson <cjwatson@chiark.greenend.org.uk>
Mon, 23 Sep 2002 13:41:19 +0000 (13:41 +0000)
committerColin Watson <cjwatson@chiark.greenend.org.uk>
Mon, 23 Sep 2002 13:41:19 +0000 (13:41 +0000)
pwhich

diff --git a/pwhich b/pwhich
index 47aa80cbad326c2c5d404769188de1d5c873aded..c78b4cd98dc26ead1586b19ad1ea2fe294148381 100755 (executable)
--- a/pwhich
+++ b/pwhich
@@ -5,7 +5,7 @@ for PROGRAM in "$@"; do
  IFS_SAVE="$IFS"
  IFS=:
  for ELEMENT in $PATH; do
  IFS_SAVE="$IFS"
  IFS=:
  for ELEMENT in $PATH; do
-  if [ -f "$ELEMENT/$PROGRAM" -a -x "$ELEMENT/$PROGRAM" ]; then
+  if [ -f "$ELEMENT/$PROGRAM" ] && [ -x "$ELEMENT/$PROGRAM" ]; then
    echo "$ELEMENT/$PROGRAM"
    RET=0
    break
    echo "$ELEMENT/$PROGRAM"
    RET=0
    break