if [ "$1"="-s" -a -n "$2" ] # if $1 is string "-s" and $2 is not null
then
string="$2" # then string="$2"
else
echo "error"
exit 1
fi
echo $string
i expect: foo -not"-s" hi return "error"
however,, no matter what i type after the - , the test will return true. why is that?
i already tried para=`echo "$@"` ; set -- $para still not working properly