好的,所以我有这个yaml文件,我想替换一个字符串
socialspy: true
与字符串
socialspy: false
但是我不知道该怎么办。这是完整的Yaml文件
timestamps: login: 1395784099618 lastteleport: 1395785353975 logout: 1395777644566 mute: 0 ipAddress: 127.0.0.1 lastlocation: world: world x: -276.7695097103249 y: 67.31022115326866 z: -354.327229975015 yaw: 127.892334 pitch: 20.817677 money: '155200.0' logoutlocation: world: world x: -252.00777100946556 y: 76.56983022033046 z: -348.45387330548886 yaw: 319.99237 pitch: 19.562881 socialspy: true godmode: true afk: false powertools: muted: false
假设您使用的操作系统不错,并且您的YAML文档称为doc:
doc
sed -i 's/socialspy: true/socialspy: false/' doc