fusionplant.com


UTC 15:12:42
Friday
5/3/2024



May 2024
SuMoTuWeThFrSa 
   1234 
567891011 
12131415161718 
19202122232425 
262728293031  
        
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