Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Same as below
- # $ tail -f /usr/share/tomcat7/logs/catalina.out | perl -pe 's/(WARN|ERROR|SEVERE)/\e[1;31;43m$&\e[0m/g'
- # $ tail -f file | perl -pe 's/keyword/\e[1;31;43m$&\e[0m/g'
- FLE="$1"
- if [ "$FLE" ]; then
- tail -f "$FLE" | perl -pe 's/(WARN|ERROR|SEVERE)/\e[1;31;43m$&\e[0m/g'
- else
- echo "[Usage] tails <file>"
- fi
Add Comment
Please, Sign In to add comment