Skip to content

Instantly share code, notes, and snippets.

@patricklucas
Created January 10, 2013 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patricklucas/4506364 to your computer and use it in GitHub Desktop.
Save patricklucas/4506364 to your computer and use it in GitHub Desktop.
Bash autocompletion for SSH config hosts.
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