grep -q VS. grep > /dev/null

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Bryan O'Neal
Date:  
To: Main PLUG discussion list
Subject: grep -q VS. grep > /dev/null
So I had a coworker ask me why I always do
echo $foo | grep $bar > /dev/null
if [[ $? -eq 0]] then; ....

Instead of just using greps quiet option. And I remember their being
some definite bug with -q and checking return codes but for the life
of me I can not recall it right now. Just like I can not recall why I
use [[ ]] insted of just [ ]. Their was a reason I switched at some
point but can not recall what it is.
It could have been somthing with egrep or using peal regex with grep
but honestly I can not recall...

Thus I am here to ask you, my fellow bash geeks, what what that reason!
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss