//View Tip #312
Similar Tips
» Change prompt color dynamically
» Counts files in the current directory and subdirectory
» Vi mode in bash
» swap files
» Changing file extensions


Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
SSH_COMPLETE=( $(cat ~/.ssh/known_hosts | \
                 cut -f 1 -d ' ' | \
                 sed -e s/,.*//g | \
                 uniq | \
                 egrep -v [0123456789]) )
complete -o default -W "${SSH_COMPLETE[*]}" ssh

View Comments »


Add your comment

Comments are currently disabled
This will not work on most systems as the known_hosts file is now stored in such a way that you can not get hostnames from it.
Posted 2008-09-17 13:56:45

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit