中间插入 str="20171125" $ echo ${str:0:4}-${str:4:2}-${str:6} 2017-11-25 取子串 $ var=“get length of me” $ echo ${var:0:3} get