在shell里面,“%”、“#”、“*” 如${a%#.}、${a%%.*}、${a##.*}
来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/08/06 05:11:28
在shell里面,“%”、“#”、“*” 如${a%#.}、${a%%.*}、${a##.*}
${varible##*string} 从左向右截取最后一个string后的字符串
${varible#*string}从左向右截取第一个string后的字符串
${varible%%string*}从右向左截取最后一个string后的字符串
${varible%string*}从右向左截取第一个string后的字符串
“*”只是一个通配符有时可以不要
例子:
$ MYVAR=foodforthought.jpg
$ echo ${MYVAR##*fo}
rthought.jpg
$ echo ${MYVAR#*fo}
odforthought.jpg
${varible#*string}从左向右截取第一个string后的字符串
${varible%%string*}从右向左截取最后一个string后的字符串
${varible%string*}从右向左截取第一个string后的字符串
“*”只是一个通配符有时可以不要
例子:
$ MYVAR=foodforthought.jpg
$ echo ${MYVAR##*fo}
rthought.jpg
$ echo ${MYVAR#*fo}
odforthought.jpg
在shell里面,“%”、“#”、“*” 如${a%#.}、${a%%.*}、${a##.*}
if[[$#-eq 1]] then a=$1 fi shell程序里面这个是什么意思呀
英语翻译A shell script is a scriptwritten for the shell,or comma
ansys shell 181 分析时报错:Shell Element 1 does not have a valid
broken shell of a man的语法结构和用法
在Linux shell脚本中,比如有个a.sh ,那么执行./a.sh .a.sh 和 sh a.sh 有什么具体的区
英语翻译It is a quest-based Digivice in a Pendulum Cycle shell.T
Principal quantum number question.For a shell which has a pr
英语翻译come out of one's shell.cook up a story a couch potato c
shell的sed:s/a/5个b/,把a替换成N个b
英语翻译C60,for example,is described as having a closed-shell co
英语翻译:in a nut shell和in the final analysis的意思