${varible##*string} --- 从左向右截取最后一个string后的字符串
${varible#*string} --- 从左向右截取第一个string后的字符串
${varible%%string*} --- 从右向左截取最后一个string后的字符串
${varible%string*} --- 从右向左截取第一个string后的字符串
“*”只是一个通配符可以不要
a="OFC1L41.0"
c=${a#*L}
d=${c%.*}
e=${c%.}
echo "d=$d;c=$c;e=$e"
try the four types all, you can find one success
string 删除
[chengmo@localhost ~]$ test='c:/windows/boot.ini'
[chengmo@localhost ~]$ echo ${test#*/}
windows/boot.ini
[chengmo@localhost ~]$ echo ${test##*/}
boot.ini
[chengmo@localhost ~]$ echo ${test%/*}
c:/windows
[chengmo@localhost ~]$ echo ${test%%/*}