|
Linux systems change the font color, it is to use "ANSI unconventional character sequence" is generated. Example:
printf ( "\ 033 [44; 37; 5m string needs to be output \ 033 [0m")
"\ 033 [44; 37; 5m" meaning:
\ 033 [change the color identifier
"44; 37; 5m" where: 44 for the font background color, as well as the range of 40-47 49.
37 font color, in the range of 30-39.
5 to select the action, ranging 01245722242527
m means setting property unconventional character sequence then ends
Font color font color background action
40 set black background 30 set black foreground property to 0 to reset the default settings
41 set red background 31 set 1 set bold red foreground
42 set green background 32 set green foreground 2 set half brightness (analog color color display)
43 set brown background 33 set brown foreground 4 set underscore (simulated color color display)
44 set blue background 34 set blue foreground setting flashes 5
45 set 35 set purple purple background foreground 7 set up a reverse image
46 set cyan background 36 set cyan foreground 22 is provided with general density
47 set white background 37 set white foreground 24 is closed underscore
49 set black background 38 set default underline the default foreground color 25 off Blinking
39 27 Close Close underline reverse image on the default foreground color
TCL used in the case, has changed:
puts "" \ 033 \ [44; 37; 5m string needs to be output \ 033 \ [0m "
The need to "[" preceded by a "\" because TCL in "[" represents the command to use, you need to use the "\" Annotated.
I was in TCL with a mix of sucess
puts "\ 033 \ [49; 32;. 5m $ table_name $ filed_name_temp value check is right \ 033 \ [0m"
error to mix
puts "\ 033 \ [49; 31; 5m $ table_name $ filed_name_temp value check is error:. \ 033 \ [0m"
For example, in a script: echo -e "! \ 033 [32m it is work \ 033 [0m"
In the script output, font it is work! Will become green, to facilitate the observation for wrong. |
|
|
|