topical media & game development
basic-shell-03-test-num.sh / sh
# Number test.
echo "**** Numeric comparisons."
x=5
y=10
echo -n "test -eq: "
if (test y) then
echo "X = Y."
else
echo "X != Y. Expected."
fi
echo -n "test -eq: "
if (test x) then
echo "X = X. Expected."
else
echo "X != X. "
fi
echo -n "test -eq: "
if (test x -eq "5") then
echo "X = \"5\". Expected."
else
echo "X != \"5\". "
fi
echo -n "test -ne: "
if (test x -ne x -eq
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.