摘要:
shell 字符串操作的几个例子,包括取长度,读取内容,删除字符串,字符串的替换。1.长度[ttoy@tttt ~]$ test='I love china'[ttoy@tttt ~]$ echo${#test}12${#变量名}得到字符串长度2.截取字串[ttoy@localhost ~]$ test='I love china'[ttoy@localhost ~]$ echo${test:5} e china[ttoy@localhost ~]$ echo ${test:5:10}echina${变量名:起始:长度}得到子字符串3.字符串删除[ttoy@lo 阅读全文