I cant seem to make this work. This is the script.
tail -fn0 nohup.out | while read line; do
if [[ "${line}" =~ ".*ERIKA.*" ]]; then
echo "match found"
break
fi
done
echo "Search done"
The code echo "Search done" does not run even after a match has been found. I just want the rest of the code to be ran when a match has been found. I have not made it possible yet.
Sorry, I am new with log monitoring. Is there any workaround with this?
I am gonna run the script via Jenkins so, the code should be free flowing and should not require any user interaction.
Please help, thanks.