Created
February 26, 2013 18:58
-
-
Save phred/5041057 to your computer and use it in GitHub Desktop.
vagrant ssh-config into shell command through the miracle of AWK. Ramen.
This file contains hidden or 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
sh -c `vagrant ssh-config | awk 'BEGIN {ORS=" "; print "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PasswordAuthentication=no"} /Port/ {print "-p",$2} /IdentityFile/ {print "-i", $2} /User / {print "-l",$2} /HostName/ {host=$2} END {print host}'` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment