Merge pull request #87 from nwinkler/ssh-completion-bash-it

Fixed SSH completion to include both config and known_hosts.
pull/92/merge
Travis Swicegood 2011-11-22 10:55:56 -08:00
commit fd9db22860
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ _sshcomplete() {
# parse all hosts found in .ssh/known_hosts
if [ -r $HOME/.ssh/known_hosts ]; then
if grep -v -q -e '^ ssh-rsa' $HOME/.ssh/known_hosts ; then
COMPREPLY=( $COMPREPLY $(compgen -W "$( awk '{print $1}' $HOME/.ssh/known_hosts | cut -d, -f 1 | sed -e 's/\[//g' | sed -e 's/\]//g' | cut -d: -f1 | grep -v ssh-rsa)" -- ${COMP_WORDS[COMP_CWORD]} ))
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$( awk '{print $1}' $HOME/.ssh/known_hosts | cut -d, -f 1 | sed -e 's/\[//g' | sed -e 's/\]//g' | cut -d: -f1 | grep -v ssh-rsa)" -- ${COMP_WORDS[COMP_CWORD]} ))
fi
fi