On Thu, Oct 13, 2011 at 3:00 PM, David Kramer <[email protected]> wrote: > I have a script at work that colorizes command outputs. I've mentioned it > here before. I have > the colors defined in environment variables: > COLOR_ERROR='\e[37;41m' > COLOR_GOOD='\e[32;40m' > COLOR_RESET='\e[0m' > COLOR_WARN='\e[33;40m'
Have you considered using the tput command to get the appropriate sequences for whatever terminal you are on rather then hardcoding them? I've only used it to "standout" text, but the terminfo(5) manual page implies there is support for color as well. I've used SMSO="`tput smso`" RMSO="`tput rmso`" to get the sequences to get in and out of standout (reverse video) mode. I was able to coax some color sequences out of tput pretty quickly, but the documentation is pretty baroque and I don't know if you will be able to get exactly what you have now or not. Good Luck, Bill Bogstad _______________________________________________ Discuss mailing list [email protected] http://lists.blu.org/mailman/listinfo/discuss
