summaryrefslogtreecommitdiff
path: root/bin/ksh/tests/th.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ksh/tests/th.sh')
-rw-r--r--bin/ksh/tests/th.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/ksh/tests/th.sh b/bin/ksh/tests/th.sh
index 6e40c19dcf9..f26b8699e94 100644
--- a/bin/ksh/tests/th.sh
+++ b/bin/ksh/tests/th.sh
@@ -4,12 +4,18 @@
# Simple script to find perl and run it
#
+# Avoid common problems with ENV (though perl shouldn't let it through)
+unset ENV
+
+x=x
+[ -x /bin/sh ] 2> /dev/null || x=f
+
IFS=:$IFS
perl=
for i in $PATH; do
[ X"$i" = X ] && i=.
for j in perl perl4 perl5 ; do
- [ -x "$i/$j" ] && perl=$i/$j && break 2
+ [ -$x "$i/$j" ] && perl=$i/$j && break 2
done
done