更改显示颜色
echo -e "\e[1;30m Jeson say Hi~ \e[1;0m"
echo -e "\e[1;30m" "Jeson say Hi~" $(tput sgr0)
$(tput sgr0)初始化终端
关联数组
-
区别
普通数组:只能使用整数作为数组索引
关联数组:可以使用字符串作为数组索引 -
申明
declare -A ass_array1
- 赋值
数组名[索引]=变量值
ass_array1[index1]=pear
echo -e "\e[1;30m Jeson say Hi~ \e[1;0m"
echo -e "\e[1;30m" "Jeson say Hi~" $(tput sgr0)
$(tput sgr0)初始化终端
区别
普通数组:只能使用整数作为数组索引
关联数组:可以使用字符串作为数组索引
申明
declare -A ass_array1
数组名[索引]=变量值
ass_array1[index1]=pear
本文标题:Shell编程
本文链接:https://www.haomeiwen.com/subject/jwvngttx.html
网友评论