Shell字符串替换sed
字符串"origin/Stable2.0"中去掉origin/,只保留Stable2.0
方法一:
test@aa:/tmp$ b="origin/Stable2.0" test@aa:/tmp$ echo $b | sed 's/origin\///' Stable2.0
方法二:
test@aa:/tmp$ b="origin/Stable2.0";a=${b/origin\//};echo $a Stable2.0
字符串"origin/Stable2.0"中去掉origin/,只保留Stable2.0
方法一:
test@aa:/tmp$ b="origin/Stable2.0" test@aa:/tmp$ echo $b | sed 's/origin\///' Stable2.0
方法二:
test@aa:/tmp$ b="origin/Stable2.0";a=${b/origin\//};echo $a Stable2.0