Created
February 1, 2012 05:00
-
-
Save zavakid/1715195 to your computer and use it in GitHub Desktop.
让终端输出颜色
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#设置颜色的格式: \e[背景色;前景色;高亮m | |
# \033[背景色;前景色;高亮m | |
#恢复默认为 \e[0m | |
#其中背景色可以被以下数字替换 | |
#第一个参数: | |
#0 透明(使用终端颜色),1 高亮 40 黑, 41 红, 42 绿, 43 黄, 44 蓝 45 紫, 46 青 | |
#绿, 47白(灰) | |
#第二个参数: | |
#前景色(也就是文本的颜色)可以被以下数字替换 | |
#30 黑 31 红, 32 绿, 33 黄, 34 蓝, 35 紫, 36 青绿, 37 白(灰) | |
#第三个参数: | |
#高亮是1,不高亮是0 | |
#第四个参数为m: | |
#注意m后面紧跟字符串。 | |
echo -e "\e[1;31m hello,red \e[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment