Monday, October 15, 2012

Bash/Shell Programming – Binary Operator Expected

http://digitalvectorz.wordpress.com/2009/12/10/bashshell-programming-binary-operator-expected/


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