我正在編寫自己的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 –