fusionplant.com


UTC 04:52:56
Wednesday
11/14/2018



November 2018
SuMoTuWeThFrSa 
    123 
45678910 
11121314151617 
18192021222324 
252627282930  
        
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