No Subject


Sun Feb 28 23:02:00 GMT 1999


~: sh try_ash yyy
Test 1 yyy
is not a switch
Test 2 yyy
is not a switch

~: sh try_ash -yyy
Test 1 -yyy
is a switch
Test 2 -yyy
is not a switch

Using sh on a SUN yields:
1-chablis$ sh try_ash yyy
try_ash: bad substitution      

Pierre

********************
#This file checks if arg1 is a switch
b=${1%%-*}
echo Test 1 "$1"
if test -z "$b"
then 
 echo is a switch
else 
 echo is not a switch
fi

#Now it tries a direct test
echo Test 2 "$1" 
if test -z "${1%%-*}"
then 
 echo is a switch
else 
 echo is not a switch
fi




More information about the Cygwin mailing list