文章目录 字符串处理1 计算字符串的长度 抽取字符串中的子串 例子 字符串处理1 计算字符串的长度 str='Hello world!' echo ${#str} ~/manageLinux_bash_python/bash_script(master ✗) echo ${#str} 12 抽取字符串中的子串 ${string:position} ${string:position:length} ${string:-position} # 从第二个字符开始,获取后面四个字符j ~/manageLinux_bash_python/bash_script(master ✗)