'||', '&&' and 'test -x' apparently don't work on Ultrix;

also 'test' appears to be available as '[' only in 'if' conditions.
This commit is contained in:
Bodo Möller
2001-04-08 13:49:45 +00:00
parent 027e257b1d
commit 5f1fddbbe7
3 changed files with 21 additions and 5 deletions

View File

@@ -12,10 +12,22 @@
IFS=:
for dir in $PATH; do
bc="$dir/bc"
try_path=true
# First we try "bc", then "$dir/bc" for each item in $PATH.
for dir in dummy:$PATH; do
if [ "$try_path" = true ]; then
# first iteration
bc=bc
try_path=false
else
# second and later iterations
bc="$dir/bc"
if [ ! -f "$bc" ]; then # '-x' is not available on Ultrix
bc=''
fi
fi
if [ -x "$bc" -a ! -d "$bc" ]; then
if [ ! "$bc" = '' ]; then
failure=none