Skip to content

Instantly share code, notes, and snippets.

@twinbird
Created January 14, 2020 05:47
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 twinbird/ae2545ce2c05d22a7c43e298bebd905e to your computer and use it in GitHub Desktop.
Save twinbird/ae2545ce2c05d22a7c43e298bebd905e to your computer and use it in GitHub Desktop.
# append for .bash_profile
# bash-completion for ssh
function _compreply_ssh(){
COMPREPLY=(`cat ~/.ssh/config | grep -i -e '^host' | cut -d " " -f 2 | grep -E "$2"`)
}
complete -F _compreply_ssh ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment