Shell 中截取字符串的方式也有很多种。1$ str=https://wxnacy.com/2020/01/13/shell-substr从索引处开始截取12$ echo ${str:6}//wxnacy.com/2020/01/13/shell-substr截取指定长度12$ echo ${str:6:8}//wxnacy从右边索引处开始截取12$ echo ${str:0-6}substr