Skip to content

Instantly share code, notes, and snippets.

@phred
Created February 26, 2013 18:58
Show Gist options
  • Save phred/5041057 to your computer and use it in GitHub Desktop.
Save phred/5041057 to your computer and use it in GitHub Desktop.
vagrant ssh-config into shell command through the miracle of AWK. Ramen.
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