Answers for "monitor log file for string"

0

monitor log file for string

tail -fn0 logfile | \
while read line ; do
        echo "$line" | grep "pattern"
        if [ $? = 0 ]
        then
                ... do something ...
        fi
done
Posted by: Guest on March-29-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language