I believe you are looking for ANSI control codes. The Ansi codes are a superset of the old DEC VT codes. There is a write up at:
http://en.wikipedia.org/wiki/ANSI_escape_codeI typed this up and it may prove interesting:
- echo "^[[30m This is black"
- echo "^[[31m This is red"
- echo "^[[32m This is green"
- echo "^[[33m This is yellow"
- echo "^[[34m This is blue"
- echo "^[[35m This is magenta"
- echo "^[[36m This is cyan"
- echo "^[[37m This is white"
- echo "^[[7m This is reverse"
- echo "^[[0m This is reset"
- echo "^[[4m This is Underline"
- echo ""
- echo "^[[5m This is Blink?Slow?"
- echo "^[[7m This is Blink?Fast?"
-
- echo "1"
- echo "2"
- echo "3"
- echo "4"
- echo "5"
- echo "6"
- echo "^[[5A up 5"
- echo "^[[5B down 5"
Please keep in mind that the ^[ followed by [ is the standard DEC "Control Sequence Introducer", CSI, Escape (0x1b) followed by the [ (0x5b). I you use the caret ^ followed by the bracket, you will see those two characters and will not be pleased with the result.