Skip to content

Instantly share code, notes, and snippets.

@kurisuchan
Created September 12, 2011 21:37
Show Gist options
  • Save kurisuchan/1212527 to your computer and use it in GitHub Desktop.
Save kurisuchan/1212527 to your computer and use it in GitHub Desktop.
Turn on Bash SSH completion
# To be added to your favorite bash config file
_compssh ()
{
cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=($(compgen -W "$(sed 's/[,| ].*$//' ~/.ssh/known_hosts)" -- $cur))
}
complete -F _compssh ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment