Why does this code work correctly, while the other version of the same condition doesn't?
if grep -q string file; then
echo found
else
echo not found
fi
This doesn't work:
if [ ! `grep -q string file` ]; then
echo not found
else
echo found
fi
-qdoes, or are you just blindly using it because you've seen others use it?