linux怎么替换文件指定行的特定位置字符串
linux如何替换文件指定行的特定位置字符串
shell脚本替换字符串,知道第几行,格式如下
<string id="str_ig_ghjjk">hello</string>
字符串内容可能是任意字符串,如何把>和<中间的字符串替换为我的字符串比如world
------解决思路----------------------
比如要替换第123行
sed -i '123s/>.*</>world</' test.txt
shell脚本替换字符串,知道第几行,格式如下
<string id="str_ig_ghjjk">hello</string>
字符串内容可能是任意字符串,如何把>和<中间的字符串替换为我的字符串比如world
------解决思路----------------------
比如要替换第123行
sed -i '123s/>.*</>world</' test.txt