#!/bin/bash
# add variables
i1=0
if [ "$1" ]; then
i1=$1
fi
#echo
#echo -e "\033[30m 黑色字oldboy trainning \033[0m"
#echo -e "\033[31m 红色字oldboy trainning \033[0m"
#echo -e "\033[32m 绿色字oldboy trainning \033[0m"
#echo -e "\033[33m ***字oldboy trainning \033[0m"
#echo -e "\033[34m 蓝色字oldboy trainning \033[0m"
#echo -e "\033[35m 紫色字oldboy trainning \033[0m"
#echo -e "\033[36m 天蓝字oldboy trainning \033[0m"
#echo -e "\033[37m 白色字oldboy trainning \033[0m"
#echo
#echo -e "\033[40;37m 黑底白字 welcome to old1boy\033[0m"
#echo -e "\033[41;37m 红底白字 welcome to old2boy\033[0m"
#echo -e "\033[42;37m 绿底白字 welcome to old3boy\033[0m"
#echo -e "\033[43;37m 黄底白字 welcome to old4boy\033[0m"
#echo -e "\033[44;37m 蓝底白字 welcome to old5boy\033[0m"
#echo -e "\033[45;37m 紫底白字 welcome to old6boy\033[0m"
#echo -e "\033[46;37m 天蓝白字 welcome to old7boy\033[0m"
#echo -e "\033[47;30m 白底黑字 welcome to old8boy\033[0m"
#echo
# add functions
function prompt()
{
read -p "$1 [YES/NO]: " input
}
# script name
function myecho0script()
{
echo
echo '==========================================================='
echo "$1"
echo '==========================================================='
echo
}
# task title
function myecho1task()
{
echo
if [ "$1" ]; then
# 蓝底白字
echo -e "\033[44;37m --> $i1. $1\033[0m"
fi
i1=$[$i1+1]
}
# things title
function myecho2thing()
{
echo
# 红色字
#echo -e "\033[31m - $1 \033[0m"
# 绿色字
echo -e "\033[32m - $1 \033[0m"
# 红底白字
#echo -e "\033[41;37m- $1\033[0m"
}
# steps title
function myecho3step()
{
echo
echo -e " * $1"
}
# reference title
function myecho4ref()
{
#echo
echo -e "\t$1"
}
# highlight title
function myechoy()
{
echo
# 黄底黑字
echo -e "\033[43;30m$1\033[0m"
#echo -e "\t\t$1"
}
# call outside script
function mysource()
{
(source $1 $i1)
i1=$[$i1+1]
}
# new chapter
myecho1task 'task'
#-----------------------------------------------------------------
myecho2thing 'things'
myecho3step 'steps'
myecho4ref 'reference'
# new chapter
echo
#echo '==========================================================='
echo 'End'
2018-05-12 Basic Shell Script of XY
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- setup-caffe.sh-20180510-yuan GPU GTX1080 Ubuntu 16.04 CUD...
- Page 14 and page 18,class 4(5) Material:Canation leaves a...
- title: shell script to convert excel to jsondate: 2015-05...