this expr can be really useful to determine if a term has been found or not using grep. short and sweet enough for me.

if [ ! -z $(echo $var | grep "cond") ]; then echo “found”; else echo ” not found”; fi

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • StumbleUpon
  • Technorati
  • LinkedIn
  • MySpace
  • Slashdot
  • TwitThis
  • Yahoo! Buzz