If I do:
if grep someexpression somefile >/dev/null; then
...
fi
Things work fine.
To do a "not", I know I can do this (using [] which is the test command):
if [ '!' somecondition ] ; then
...
fi
A simple workaround:
grep someexpression somefile >/dev/null
if [ '!' $? ]; then
...
fi
But the above workaround won't work with a while loop, so then I need to write a function instead, which is annoying. How do I do a not with the grep thing above, the proper way?