echo the command line to print colored characters

When writing a shell script, for some output characters highlighted optimized to use echo -e output
format echo -e "\ 033 [3xmhello \ 033 [0m"
format echo -e "\ 033 [3x; 4xmhello \ 033 [0m "
\ 033 [3 xm to ANSI control codes, have pledged to begin output color of the characters
\ 033 [0m to ANSI control codes, indicating the end of output colored characters
Note: the characters to be output, and foreground color (30m) next the front with a space character if output will have spaces.
Example:
echo -e "\ 033 [30mhello \ 033 [0m"
echo -e "\ 033 [30; 43mhello \ 033 [0m"

30 represents the prospects black.
31 shows the prospect red.
Green represents 32 prospects.
33 represents the prospects yellow.
34 shows the outlook blue.
35 represents the prospect purple.
36 shows a light blue prospects.
37 represents the prospect of gray.

40 represents the background is black.
41 denotes a red background.
42 shows a green background.
43 shows a yellow background.
44 represents the blue background.
45 shows a purple background.
46 shows a light blue background.
47 shows an off-white background.

Guess you like

Origin blog.51cto.com/13708014/2452504