Created
January 10, 2013 22:27
-
-
Save patricklucas/4506364 to your computer and use it in GitHub Desktop.
Bash autocompletion for SSH config hosts.
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
function _ssh_completion() { | |
perl -ne 'print "$1 " if /^Host (.+)$/' ~/.ssh/config | |
} | |
complete -W "$(_ssh_completion)" ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment