我希望在安装时使用bash脚本将bindIP: 127.0.0.0替换为bindIp : 0.0.0.0。谁能告诉我怎么通过bash来做这件事吗?
编辑部分:
# network interfaces
net:
port: 27017
bindIp: 127.0.0.0将127.0.0.0替换为0.0.0.0
我正在使用的命令:
sed '0,/bindIp:*;/s//bindIp: 0.0.0.0;/' /etc/mongod.conf发布于 2018-10-15 06:02:20
sed "s,\\(^[[:blank:]]*bindIp:\\) .*,\\1 0.0.0.0," /etc/mongod.conf如果要动态编辑文件,请使用选项-i
sed -i "s,\\(^[[:blank:]]*bindIp:\\) .*,\\1 0.0.0.0," /etc/mongod.confhttps://stackoverflow.com/questions/52810487
复制相似问题