我正在编写自己的shell脚本来安装和设置vagrant,并且我想写入vvv-custom.yml
文件,以便我可以添加自己的自定义站点。我在init.sh
文件添加在文件插入文件后恢复执行shell脚本
#!/bin/sh
# Other code is here
touch vvv-custom.yml;
/bin/cat > vvv-custom.yml <<- EOM
---
sites:
# My site
# Site is situated in www/my-site/ available at http://my-site.dev. Other sites will be multisite of the main site.
my-site:
hosts:
- my-site.dev
- site1.my-site.dev
- site2.my-site.dev
- site3.my-site.dev
custom:
wp_type: subdomain
EOM
echo "Blaaaaa"
(安装和setuping流浪汉后)我希望看到的是与那些EOM
之间(即发生)的内容创建新的文件,然后就Blaaaaa
写出我的终端。但是,整个echo "Blaaaaa"
被写入我的vvv-custom.yml
文件中。
我在这里做错了什么?我想提供下一个流浪汉,但这有点麻烦。
你使用的是什么操作系统或sh版本?我无法重现您的错误 –
MacOS Sierra,GNU bash,版本3.2.57(1) - 释放(x86_64-apple-darwin16)。奇怪的是,当放在它自己的回声在新创建的文件中,但是当我放置其他代码时,它似乎正在工作:S –