当前位置: 技术问答>linux和unix
请问如何使printf的输出有颜色???
来源: 互联网 发布时间:2015-09-17
本文导语: ???? | printf("33[1;33mhello world.33[0mn") 颜色如下: none="33[0m" black="33[0;30m" dark_gray="33[1;30m" blue="33[0;34m" light_blue="33[1;34m" green="33[0;32m" light_green="33[1;32m" cyan="33[0;36m" light_cyan="33[1;36m" red="33[0;31m" light_red=...
????
|
printf("33[1;33mhello world.33[0mn")
颜色如下:
none="33[0m"
black="33[0;30m"
dark_gray="33[1;30m"
blue="33[0;34m"
light_blue="33[1;34m"
green="33[0;32m"
light_green="33[1;32m"
cyan="33[0;36m"
light_cyan="33[1;36m"
red="33[0;31m"
light_red="33[1;31m"
purple="33[0;35m"
light_purple="33[1;35m"
brown="33[0;33m"
yellow="33[1;33m"
light_gray="33[0;37m"
white="33[1;37m"
颜色如下:
none="33[0m"
black="33[0;30m"
dark_gray="33[1;30m"
blue="33[0;34m"
light_blue="33[1;34m"
green="33[0;32m"
light_green="33[1;32m"
cyan="33[0;36m"
light_cyan="33[1;36m"
red="33[0;31m"
light_red="33[1;31m"
purple="33[0;35m"
light_purple="33[1;35m"
brown="33[0;33m"
yellow="33[1;33m"
light_gray="33[0;37m"
white="33[1;37m"
|
printf("33[1;33mhello world.33[0mn")
颜色如下:
none="33[0m"
black="33[0;30m"
dark_gray="33[1;30m"
blue="33[0;34m"
light_blue="33[1;34m"
green="33[0;32m"
light_green="33[1;32m"
cyan="33[0;36m"
light_cyan="33[1;36m"
red="33[0;31m"
light_red="33[1;31m"
purple="33[0;35m"
light_purple="33[1;35m"
brown="33[0;33m"
yellow="33[1;33m"
light_gray="33[0;37m"
white="33[1;37m"