I am writing a bash to monitor a logfile and would like to do something real quick after hitting certain line, some how it takes probably 6-8s to respond the <do_something>, anyway i could increase the responsive of my script? Here's my script
#!/bin/bash
tail -f screenlog.0 | while read LOGLINE
do
[[ "${LOGLINE}" == *"Restarting system"* ]] && <do_something>
if [ $? == 0 ]
then
break
fi
done
Please advise any improvement or perhaps this can be done with 1 line command? Thanks