This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 28th, 2012  |  syntax: None  |  size: 0.85 KB  |  views: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. if [ $# -eq 0 ]; then
  4.     echo "$0 /path/to/log"
  5.     exit
  6. fi
  7.  
  8. # Escaped color codes
  9.      BLACK=`echo -e '\033[0;30m'`
  10.    DK_GREY=`echo -e '\033[1;30m'`
  11.        RED=`echo -e '\033[0;31m'`
  12.       PINK=`echo -e '\033[1;31m'`
  13.      GREEN=`echo -e '\033[0;32m'`
  14.   LT_GREEN=`echo -e '\033[1;32m'`
  15.      BROWN=`echo -e '\033[0;33m'`
  16.     YELLOW=`echo -e '\033[1;33m'`
  17.       BLUE=`echo -e '\033[0;34m'`
  18.    LT_BLUE=`echo -e '\033[1;34m'`
  19.     PURPLE=`echo -e '\033[0;35m'`
  20.  LT_PURPLE=`echo -e '\033[1;35m'`
  21.       CYAN=`echo -e '\033[0;36m'`
  22.    LT_CYAN=`echo -e '\033[1;36m'`
  23.    LT_GREY=`echo -e '\033[0;37m'`
  24.      WHITE=`echo -e '\033[1;37m'`
  25. COLOR_NONE=`echo -e '\033[0m'`
  26.  
  27.  
  28. tail -f $1 | sed \
  29.     -e "/GET \/favicon.ico/d" \
  30.     -e "s/^.* 40[012356789] .*$/$PINK&$COLOR_NONE/" \
  31.     -e "s/^.* 404 .*$/$BROWN&$COLOR_NONE/" \
  32.     -e "s/^.* 500 .*$/$PURPLE&$COLOR_NONE/"
clone this paste RAW Paste Data