<分区>
我有一个 config.js 文件,其中包含以下字符串
.constant('Digin_Engine_API', 'http://local.net:1929/')
我想读取此文件并替换 .constant('Digin_Engine_API'
我尝试使用 sed
但 ddnt 有效。这是我用于 sed 的内容
sed -i 's/^.constant('Digin_Engine_API', .*/http://cloud.lk:8080/' /var/config.js
作为总结,我的最终输出 (config.js) 文件需要包含以下内容。
之前
.constant('Digin_Engine_API', 'http://local.net:1929/')
之后
.constant('Digin_Engine_API', 'http://cloud.lk:8080/')