댓글 쓰기 권한이 없습니다. 로그인 하시겠습니까?
LINUX
2014.09.23 11:30
[Shell Script] 글자 속성, 색깔 지정
조회 수 36500 댓글 0
echo -e "\033[COLOR1;COLOR2m sample text\033[0m" [ TEXT ATTRIBUTES ] ANSI CODE Meaning 0 Normal Characters 1 Bold Characters 4 Underlined Characters 5 Blinking Characters 7 Reverse video Characters [ COLORS ]
echo -e "\033[COLORm Sample text" The "\033[" begins the escape sequence.You can also use "\e[" instead of "\033[". COLOR specifies a foreground color, according to the table above.The "m" terminates escape sequence, and text begins immediately after that. Note: With an echo, the -e option enables the escape sequences.You can also use printf instead of echo. printf "\e[COLORm sample text\n" To print Green text echo -e "\033[32m Hello World" or printf "\e[32m Hello World" 정상으로 돌아오려면 echo -e "\033[0m" [ Some examples ] Block background and white text
Reverse video text attribute option interchanges fg and bg colors. Bellow statement prints block on white
[ The "tput" command: ] Other than echo there is a command called tput using which we can control the way the output is displayed on the screen.But it is less flexible than ANSI escape sequences. [ SCRIPT SAMPLE ]
[ANSI 문자]
TAG •
Dreamy의 코드 스크랩내가 모으고 내가 보는
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Designed by sketchbooks.co.kr / sketchbook5 board skin
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5