shell脚本基础
shell变量定义变量时,变量名不加美元符号($,PHP语言中变量需要),如:your_name="runoob.com"使用变量:echo $your_nameecho "i deng ${your_name} "删除变量:unset your_name获取字符串的长度:echo ${#yourname}提取字符串:echo ${your_name:1:4} #输出un00#第一个字符的索引值为0查找子字符串:echo `expr index "$your_name"
原创
2021-09-04 18:50:16 ·
407 阅读 ·
0 评论