VAR=hahaha echo ${VAR#*h} # ahaha
从前向后匹配删除
VAR=hahaha echo ${VAR##*h} # a
贪婪模式,从前向后匹配删除所有
VAR=hahaha echo ${VAR%a*} # hahah
从后向前匹配删除
VAR=hahaha echo ${VAR%%a*} # h
贪婪模式
VAR=hahaha echo ${VAR/a/A} # hAhaha
一次替换
VAR=hahaha echo ${VAR//a/A} # hAhAhA
全部替换