fusionplant.com


UTC 07:08:16
Thursday
9/20/2018



September 2018
SuMoTuWeThFrSa 
      1 
2345678 
9101112131415 
16171819202122 
23242526272829 
30       
Calendar Tool

welcome

Color Escape Sequences

Use these escape sequences to change colors of texts on a color xterm. The table below shows values and their actions. Use the simple scripts below as examples of how to make use of these characteristics.


In sh, use this script:
esc=`echo -e '\e'`
color="${esc}[31;47m"
normal="${esc}[0m"
echo "${color}Color Test: here are the results${normal}"



In perl, use this script:
$esc = "\e";
$color = $esc . "[31;47m";
$normal = $esc . "[0m";
print $color . "Color Test: here are the results$normal\n";


AttributeDescription
0Cancel all attributes except foreground/background color
1Bright (bold)
2Normal (not bold)
4Underline
5Blink
7Reverse video
8Concealed (don't display characters)
30Make foreground (the characters) black
31Make foreground red
32Make foreground green
33Make foreground yellow
34Make foreground blue
35Make foreground magenta
36Make foreground cyan
37Make foreground white
40Make background (around the characters) black
41Make background red
42Make background green
43Make background yellow
44Make background blue
45Make background magenta
46Make background cyan
47Make background white (you may need 0 instead, or in addition)

1