Advertisement
bonsaiviking

cgrep

Nov 8th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. cgrep() {
  2.     case $1 in
  3.         r*)
  4.             GREP_COLOR="01;31"
  5.             ;;
  6.         g*)
  7.             GREP_COLOR="01;32"
  8.             ;;
  9.         y*)
  10.             GREP_COLOR="01;33"
  11.             ;;
  12.         b*)
  13.             GREP_COLOR="01;34"
  14.             ;;
  15.         m*)
  16.             GREP_COLOR="01;35"
  17.             ;;
  18.         c*)
  19.             GREP_COLOR="01;36"
  20.             ;;
  21.         w*)
  22.             GREP_COLOR="01;37"
  23.             ;;
  24.     esac
  25.     shift
  26.     GREP_COLOR=$GREP_COLOR egrep --color=always "$@"
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement