字符串操作 1、获取字符串长度: string=“abcd” echo ${#string} #输出:4 2、提取子字符串 string=“alibaba is a great company” echo ${string:1:4} #输出:liba expr命令 1、计算字串长度 expr length “this is a test” 14