You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there @anasbouzid - This is actually something I've been meaning to document. When you use the run option with inline scripts, you are executing a shell subprocess, not a bash session. You are not the first person to run into this.....IO redirection with that operator is actually something within bash, so you'll want to do something like this to execute your script in bash:
brian@localghost:vagrant-sandbox % be vagrant up bork ±[●][master]
Bringing machine 'bork' up with 'virtualbox' provider...
==> bork: Checking if box 'bento/ubuntu-18.04' version '201812.27.0' is up to date...
==> bork: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> bork: flag to force provisioning. Provisioners marked to run always will still run.
==> bork: Running action triggers after up ...
==> bork: Running trigger...
bork: Running local: Inline script
bork: /bin/bash -c 'date >> outfile.txt'
brian@localghost:vagrant-sandbox % ls outfile.txt ±[●●][master]
outfile.txt
brian@localghost:vagrant-sandbox % cat outfile.txt ±[●●][master]
Thu Feb 21 11:22:43 PST 2019
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
On triggers, I/O redirection doesn't work with the
inline
shell setting, using thepath
shell setting works normally.Vagrant version
2.2.3
Host operating system
Ubuntu 16.04
Guest operating system
Ubuntu 18.04
Vagrantfile
Debug output
https://gist.github.com/anasbouzid/e1144379ee8213c63d6370295234b053
Expected behavior
Append current date to
outfile
Actual behavior
fails:
Steps to reproduce
Run
vagrant up
The text was updated successfully, but these errors were encountered: