if [ $1 == $2 ] ; then
echo "Equal"
else
echo "not equal"
fi
if [ $1 != $2 ]; then
echo "not equal"
else
echo "equal"
fi
if [ $1 == "test" ] ; then
echo "Equal"
else
echo "not equal"
fi
reference:
http://www.tech-recipes.com/rx/209/bournebash-shell-scripts-string-comparison/
No comments:
Post a Comment