[Shell Tips] sed: 將找到字串存起來, 取出

sed: 將找到字串存起來, 取出

sed -n 's/\(La\)/\1Oo/p' dataf3
把找到的 La 存起來,用 \1 取回來使用
sed -i 取代修改原始檔

參考來源: [Linux] sed replace 指令

This entry was posted in shell script and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *