Created
April 30, 2014 00:40
-
-
Save dux/bd9bbe6ddb57d2a6b230 to your computer and use it in GitHub Desktop.
colorized grep # memcached -vv 2>&1 | cgrep GET SET # for resoult of http://i.imgur.com/ifnrEj9.png
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'colorize' | |
colors = [:green, :red, :yelow, :blue] | |
$stdin.each_line do |l| | |
for el, i in ARGV.each_with_index | |
next unless l =~ /#{el}/ | |
print l.send(colors[i]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment