Rainbow Grep!
Put this in your .bashrc or .bash_profile for a new grep colour each time it's run.
export GREP_OPTIONS='--color=auto'
grep_path=$(which grep)
function grep() {
# change the colour for next time
export GREP_COLOR="1;$(( $RANDOM % 6 + 31 ))"
# and run the usual grep with the args provided
$grep_path "$@"
}
Easy :)
Written by Mark McD ☠
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#