Coloured Tail file

Coloured Tail File

Log file Column Colours

Here is an example for colouring columns while tailing a file.

while IFS='| ' read -a columns; do for c in "${!columns[@]}"; do printf '| %s%s%s ' "$(tput setaf $c)" "${columns[c]}" "$(tput sgr0)"; done; echo '|'; done < /var/log/tomcat5/statistics.log

useful: http://linuxtidbits.wordpress.com/2008/08/11/output-color-on-bash-scripts/


Browse Space

- Pages
- News
- Labels
- Attachments
- Bookmarks
- Mail
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

 

Other Features

Add Content

- Add Comment