« HEAD revision of a remote subversion repository | Main | VMWare Server command-line tools to the rescue »

February 8, 2005

Sweet bash ssh completion trick

Brian McCallister just posted the nicest
bash ssh completion trick
. Check it out:

#!/bin/sh
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

Yum!

Posted by gozer at February 8, 2005 1:03 AM

Comments

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please enter the security code you see here


Remember me?