I am using tail to read a logfile as it is updated and wish to exit the loop if grep returns a specific string. I’m not sure how to exit or kill the process ‘programmatically’
Anyone have any great ideas?
Here’s some sample script:
tail -f /var/log/{system.log,kernel.log} | grep -i "vendor: 0x22b8"
Thanks 🙂
Use
grepwith a maximum count: