Guest User

Untitled

a guest
Jan 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Same as below
  4. # $ tail -f /usr/share/tomcat7/logs/catalina.out | perl -pe 's/(WARN|ERROR|SEVERE)/\e[1;31;43m$&\e[0m/g'
  5. # $ tail -f file | perl -pe 's/keyword/\e[1;31;43m$&\e[0m/g'
  6.  
  7. FLE="$1"
  8.  
  9. if [ "$FLE" ]; then
  10. tail -f "$FLE" | perl -pe 's/(WARN|ERROR|SEVERE)/\e[1;31;43m$&\e[0m/g'
  11. else
  12. echo "[Usage] tails <file>"
  13. fi
Add Comment
Please, Sign In to add comment