一、语法
变量替换二、例子
variable_1="I love you,Do you love me"
var1=${variable_1#*ov}
// e you,Do you love me
var2=${varible_1##*ov}
// e me
var3=${varible_1%ov*}
//I love you,Do you l
var4=${varible_1%%ov*}
// I l
var5=${PATH/bin/BIN}
// /usr/local/BIN:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/antiai/.local/bin:/home/antiai/bin
var6=${PATH//bin/BIN}
// /usr/local/BIN:/usr/local/sBIN:/usr/BIN:/usr/sBIN:/BIN:/sBIN:/home/antiai/.local/BIN:/home/antiai/BIN
变量测试
网友评论