5 ms·
I'm not in my computer now, but doesn't "grep -v" solves your issue? If I remember correctly, it inverts the query, so it would return 0 if there wasn't a match
by vitorbaptistaa 8y ago
I'm not in my computer now, but doesn't "grep -v" solves your issue? If I remember correctly, it inverts the query, so it would return 0 if there wasn't a match.
- Sean1708 8y agoNo, -v will return 0 unless every line matches: $ cat > foo here's some random text $ grep -v some foo; echo $? here's random text 0 $ grep -v bar foo; echo $? here's some random text 0 $ grep -vE "(here's|some|random|text)" foo; echo $? 1