2016-03-03 116 views

回答

1
sed 's/run_id = \([[:digit:]]\+\)/run_id between \1 and \1/g' 

使用\(\)爲捕獲括號。一個 演示

sed 's/run_id = \([[:digit:]]\+\)/run_id between \1 and \1/g' <<END 
some text run_id = 1234 some text 
END 
some text run_id between 1234 and 1234 some text 
+0

美麗!非常感謝! –

相關問題