This is great stuff. Thanks! - Jared On Wednesday 13 March 2002 07:25 pm, you wrote: > been wanting to know how to print fancy colors in shell scripts for about > as long as I've seen Linux in use. > I finally spent the time to figure it out. :) > mind you, this is bash 2.05; not guaranteed to work anything like the same > way, anywhere else. > > here's an example script: > #!/bin/bash > COLORS='\n > \e[1mBold Text\e[m\n > \e[4mUnderline Text\e[m\n > \e[5mBlink Text\e[m\n > \e[7mInverse Text\e[m\n > Should be normal text \n > Foreground colors: > \e[0;30m30: Black\n > \e[0;31m31: Red\n > \e[0;32m32: Green\n > \e[0;33m33: Yellow\Orange\n > \e[0;34m34: Blue\n > \e[0;35m35: Magenta\n > \e[0;36m36: Cyan\n > \e[0;37m37: Light Gray\Black\n > \e[0;39m39: Default\n > Bright foreground colors: \n > \e[1;30m30: Dark Gray\n > \e[1;31m31: Red\n > \e[1;32m32: Green\n > \e[1;33m33: Yellow\n > \e[1;34m34: Blue\n > \e[1;35m35: Magenta\n > \e[1;36m36: Cyan\n > \e[1;37m37: White\n > \e[0;39m39: Default\n > \e[mBackground colors: \n > \e[40m40: Black\e[0;49m\n > \e[41m41: Red\e[0;49m\n > \e[42m42: Green\e[0;49m\n > \e[43m43: Yellow\Orange\e[0;49m\n > \e[44m44: Blue\e[0;49m\n > \e[45m45: Magenta\e[0;49m\n > \e[46m46: Cyan\e[0;49m\n > \e[47m47: Light Gray\Black\e[0;49m\n > \e[49m49: Default\e[m\n' > > echo -e $COLORS > > > and for a command that sets brightness, text color, and background color; > then resets it back to normal, try: > echo -e '\e[1m\e[33m\e[44mBright Yellow on Blue!\e[m' > > Carl Soderstrom.