public
Created

Scan a file until a pattern occurs

  • Download Gist
ScannerLog.sh
Shell
1 2 3 4 5 6
#!/bin/bash
# ScannerLog.sh: Scan a log until a pattern occurs.
 
LOG=/var/log/tomcat/catalina.out
 
sed '/^INFO: Server startup/q' <(tail -n 0 -f $LOG)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.