Question : bash true if grep has output
Answered by : blushing-booby-bwnqpljc0bp0
if grep -q PATTERN file.txt; then echo found
else echo not found
fi
Source : https://unix.stackexchange.com/questions/48535/can-grep-return-true-false-or-are-there-alternative-methods | Last Update : Thu, 12 Aug 21