sed替换整行
sed '5s/^.*$/xxxxx/' file
把第5行替换为xxxxx
如果 要直接在本文件中修改,则加上 -i
比如:
sed -i '5s/^.*$/xxxxx/' file
sed匹配某一行开头,替换整行内容
sed -i '/^swver/c\swver=SD_V1.0.7/' config_test
--------------------------
sed -i "/window.baseUrl/c\ window.baseUrl = 'http://12.21.3.13:88'\;" index.js
sed -i "5s/^.*$/ window.baseUrl_xg = 'http:\/\/12.21.3.13:88\/'\;/" index.js
浙公网安备 33010602011771号