if [[ -n `ls | grep something` ]]; then
echo "Success";
fi
Nested if/then condition:
http://tldp.org/LDP/abs/html/nestedifthen.html
if [ "$a" -gt 0 ]
then
if [ "$a" -lt 5 ]
then
echo "The value of \"a\" lies somewhere between 0 and 5."
fi
fi
No comments:
Post a Comment