Created
October 5, 2009 17:02
-
-
Save roder/202244 to your computer and use it in GitHub Desktop.
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
# copy this to ~/.bashrc | |
_complete_ssh_hosts () { | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
comp_ssh_hosts=` | |
grep "^host " ~/.ssh/config | \ | |
awk '{print $2}' | |
` | |
COMPREPLY=( $(compgen -W "${comp_ssh_hosts}" -- $cur)) | |
return 0 | |
} | |
complete -F _complete_ssh_hosts ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment