Nifty Bash Complete for SSH known_hosts
Just came across this today... Really useful, since 90% of my job requires SSHing off to remote hosts...
From drawohara:
Stick this in your ~/.bashrc
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
This does a lookup for all the hosts in your ~/.ssh/known_hosts file, as a source for the autocompletion.
0 TrackBacks
Listed below are links to blogs that reference this entry: Nifty Bash Complete for SSH known_hosts.
TrackBack URL for this entry: http://daffy.za.net/cgi-bin/mt/mt-tb.cgi/111


Leave a comment
Powered by Ajax Comments