shell截取字符串
image_tag="pangu-20151021102145\""
1、用#号截取,符号-右面所有字符串
TMP=${image_tag#*-}
echo $TMP
得到20151021102145"
2、用%截取,保存左边的内容
TMP1=${TMP%\"*}
echo $TMP1
得到20151021102145
image_tag="pangu-20151021102145\""
1、用#号截取,符号-右面所有字符串
TMP=${image_tag#*-}
echo $TMP
得到20151021102145"
2、用%截取,保存左边的内容
TMP1=${TMP%\"*}
echo $TMP1
得到20151021102145