[英]GCP VM startup script sed: can't read : No such file or directory
I have a terraform GCP VM instance (Ubuntu 18.04 LTS Minimal) metadata startup script which is defined via inline.我有一个通过内联定义的 terraform GCP VM 实例(Ubuntu 18.04 LTS Minimal)元数据启动脚本。 The startup script downloads a file
config.toml
then edits the file config.toml
via sed
.启动脚本下载文件
config.toml
然后通过sed
编辑文件config.toml
。 When I check the startup script logs via当我通过检查启动脚本日志时
cat /var/log/syslog
sed: can't read: No such file or directory
sed:无法读取:没有这样的文件或目录
My startup script for sed
:我的
sed
启动脚本:
chmod -R 777 /pd-disk/config.toml
sed -i 's/http:\/\/localhost:8545/http:\/\/bor:8545/g' /pd-disk/config.toml
I know the command works properly if I SSH into the VM and manually execute the sed
command:如果我 SSH 进入 VM 并手动执行
sed
命令,我知道该命令可以正常工作:
sed -i 's/http://localhost:8545/http://bor:8545/g' /pd-disk/config.toml
What is the proper method or syntax for sed to execute within the startup script? sed 在启动脚本中执行的正确方法或语法是什么?
You can use sed command in many ways...您可以通过多种方式使用 sed 命令...
Below are examples to replace 'abc' with 'def'下面是用 'def' 替换 'abc' 的示例
In this way, you can use any delimiter as separator.这样,您可以使用任何分隔符作为分隔符。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.