-
-
Save mykter/2d1589d401e72de67c94 to your computer and use it in GitHub Desktop.
Copy a file between a Vagrant VM and the host with scp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Change these settings to match what you are wanting to do | |
FILE=/File/To/Copy | |
PATH=/Where/To/Put/File | |
OPTIONS=`vagrant ssh-config | awk -v ORS=' ' 'NF{print "-o " $1 "=" $2}'` | |
# To copy a file from a Vagrant VM to the host: | |
# scp ${OPTIONS} v:$FILE $PATH | |
# To copy a file from the host to a Vagrant VM: | |
scp ${OPTIONS} $FILE v:$PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment