【发布时间】:2020-11-24 01:14:05
【问题描述】:
我的配置文件如下所示:
KEY1=VALUE1
URL=https://drive.google.com/uc?export=download&id=myhash
KEY3=VALUE3
我正在尝试使用 sed 将 URL 值替换为另一个值。我得到了以下内容:
sed -i.bak 's@URL=.*@URL=https://drive.google.com/uc?export=download&id=mynewhash@g' file.txt
但这似乎不起作用,因为我得到了:
URL=https://drive.google.com/uc?export=downloadURL=https://drive.google.com/uc?export=download&id=mynewhash=myhash
我错过了什么?谢谢
【问题讨论】:
标签: sed