if constuct
The if condition can test various conditions.
Usage of if to test successful execution of commands:
if cp src dst
then
echo "cp succeeded"
fi
Usage of test directive with if:
if test a -lt b
then
echo "a < b"
fi
Usage of if with [ ]
if [ a -lt b ]
then
echo "a < b"
fi
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment