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
结果如下:
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。