Shirker's blog about IT stuff

Monday, August 11, 2014

GREP: colored output

http://stackoverflow.com/questions/17236005/grep-output-with-multiple-colors

EXAMPLE:  Colored output from asterisk CLI

 asterisk -rvvvvvvv | GREP_COLOR='01;36' egrep --color=always '^.*answered SIP.*$|$' | GREP_COLOR='01;31' egrep -i --color=always '^.*Got SIP response.*$|$' | grep -E '(answered SIP|Got SIP response)'
Posted by shirker at 11:44 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: color, grep

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2018 (1)
    • ►  April (1)
  • ►  2017 (1)
    • ►  August (1)
  • ►  2016 (3)
    • ►  September (1)
    • ►  January (2)
  • ►  2015 (11)
    • ►  August (3)
    • ►  June (6)
    • ►  April (1)
    • ►  January (1)
  • ▼  2014 (19)
    • ►  September (1)
    • ▼  August (6)
      • Modify all LDAP users in one shot
      • Asterisk(Bash): watching agents on call/waiting in...
      • ZFS::chmod: changing permissions of Operation not...
      • GREP: colored output
      • BASH Shell: For Loop File Names With Spaces
      • bash:: tolowercase,to uppercase
    • ►  July (2)
    • ►  May (2)
    • ►  April (2)
    • ►  January (6)
  • ►  2013 (27)
    • ►  December (1)
    • ►  November (1)
    • ►  October (8)
    • ►  September (17)
Simple theme. Powered by Blogger.