1
添加新的文本,我有:使用sed命令在一行
Format "%x %x %x %x \"%x\" %>x %x \"%{xxx}i\" \"%{xxx}i\""
如何使用sed命令,使其:
Format "%{X-Y-Z}i - %x %x %x %x \"%x\" %>x %x \"%{xxx}i\" \"%{xxx}i\""
基本上,我要補充%{X-Y-Z}i
。
添加新的文本,我有:使用sed命令在一行
Format "%x %x %x %x \"%x\" %>x %x \"%{xxx}i\" \"%{xxx}i\""
如何使用sed命令,使其:
Format "%{X-Y-Z}i - %x %x %x %x \"%x\" %>x %x \"%{xxx}i\" \"%{xxx}i\""
基本上,我要補充%{X-Y-Z}i
。
sed 's/\(^Format\ "\)\(.*$\)/\1%{X-Y-Z}i\ -\ \2/'
這oneliner被插入Format "
和%
第一次出現之間恰好%{X-Y-Z}i -
。
目前,這只是一個問題陳述,而不是問題。你應該編輯它,並將它變成一個問題,通過添加一個問題,你已經嘗試了什麼,發生了什麼以及你期望發生什麼。 –
相當簡單的問題,看看https://stackoverflow.com/documentation/sed/934/getting-started-with-sed#t=20170509053311177556,並問你是否卡住... – Sundeep
我不想用回聲..我們可以用只是sed命令嗎? – Dheeraj