Nifty Bash Complete for SSH known_hosts

| | Comments (0) | TrackBacks (0)

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.

Categories

,

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

About this Entry

This page contains a single entry by Kieran Murphy published on September 9, 2008 5:22 PM.

Jawug gets a mention on ZA Tech Show was the previous entry in this blog.

Well rub me in seasoning and slap me with a sausage is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Syndicate

Powered by Movable Type 4.21-en