1 想必大家都想在写脚本执行的时候,有醒目的提示颜色吧,贡献我收集的华丽的色值表。 #!/bin/bash #======================================================================================= # FILE: Colourful.sh # USAGE: bash Colourful.sh |sh Colourful.sh # DESCRIPTION: Print World Colour. # OPTIONS: see fuction ‘usage‘ below # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Dr.-Vision. Simple(sp) # COMPANY: China # VERSION: 1.0 # CREATED: 12.07.2015 - 10:15:30 # REVISION: 12.07.2015 # PROJECT: XXX # COPYRITHT: Copyright(c)2002-2020 Shell, All Rights Reserved #======================================================================================= # Shell Var Here # Function comments #=== FUNCTION ==================================================================== # NAME: Colourful_Style # DESCRIPTION: 打印Shell的色值表. # PARAMETER 1: --- #======================================================================================= function Colourful_Style { printf "======================== 华丽的色值表 Style 1 ========================\n\n" for ((style=0;style<=7;style++)) { for ((fg=30;fg<=37;fg++)) { for ((bg=40;bg<=47;bg++)) { #echo $style $fg $j crt="\033[${style};${fg};${bg}m" printf "${crt}" printf "%s" "sg:${style}-fg:${fg}-bg:${bg}" printf "\033[0m" } printf "\n" } printf "\n" } printf "======================== 华丽的色值表 Style 2 ========================\n\n" for ((STYLE=0;STYLE<=7;STYLE++)) { for ((FG=30;FG<=37;FG++)) { for ((BG=100;BG<=107;BG++)) { #echo $style $fg $j CRT="\033[${STYLE};${FG};${BG}m" printf "${CRT}" printf "%s" "STY:${STYLE}-cFG:${FG}-cBG:${BG}" printf "\033[0m" } echo } echo } } # Section comments #--------------------------------------------------------------------------------------- # define main. #--------------------------------------------------------------------------------------- Colourful_Style # line end comments
结果如下:
本文出自 “关注后台设计” 博客,请务必保留此出处http://xleft.blog.51cto.com/955567/1895559
原文地址:http://xleft.blog.51cto.com/955567/1895559