Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Autocomplete for ssh hostnames
_compssh ()
{
cur=${COMP_WORDS[COMP_CWORD]};
COMPREPLY=($(compgen -W '$(sed -e "s/,.*$//" ${HOME}/.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
You can’t perform that action at this time.