Sri

Instead of using the escapes, have you tried the tput options listed above?

RED=`tput setaf 1`
GREEN=`tput setaf 2`
NC=`tput sgr0`

-or-

RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
NC=$(tput sgr0)