From 79f0da50312b063b98090eca569331097a03e02a Mon Sep 17 00:00:00 2001 From: Ben Bunk Date: Sat, 9 Mar 2013 20:03:42 -0300 Subject: [PATCH] Update completions with known_hosts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding Jason Friedland's known_hosts autocomplete for cases where the address isn't in the hosts file. See http://blog.friedland.id.au/2009/04/ssh-hostname-autocomplete.html --- bash/completions | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bash/completions b/bash/completions index 2672653..90f343f 100644 --- a/bash/completions +++ b/bash/completions @@ -4,4 +4,9 @@ fi complete -W "$(echo `grep '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' /etc/hosts | awk '{print $2}'`;)" ssh +# Jason Friedland SSH Known Hosts Autocomplet - http://blog.friedland.id.au/2009/04/ssh-hostname-autocomplete.html +complete -W "$(echo $(cat ~/.ssh/known_hosts | \ + cut -f 1 -d ' ' | sed -e s/,.*//g | \ + sort -u | grep -v "\["))" ssh + source ~/dotfiles/bash/bash_drush