From d38f1380e9f294dfe587190e1591b8fd409c7366 Mon Sep 17 00:00:00 2001 From: Greg Dietsche Date: Mon, 1 Apr 2013 16:42:40 -0500 Subject: [PATCH] Ignore hashed host names in ssh/known_hosts Valid DNS names cannot have a | character and hashed ssh hosts always begin with the | character. Therefore we ignore lines that begin with |. Signed-off-by: Greg Dietsche --- share/functions/__fish_print_hostnames.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish index 0f3facbbc..7e4c23bff 100644 --- a/share/functions/__fish_print_hostnames.fish +++ b/share/functions/__fish_print_hostnames.fish @@ -13,7 +13,7 @@ function __fish_print_hostnames -d "Print a list of known hostnames" end # Print hosts with known ssh keys - cat ~/.ssh/known_hosts{,2} ^/dev/null|cut -d ' ' -f 1| cut -d , -f 1 + cat ~/.ssh/known_hosts{,2} ^/dev/null | grep -v '^|' | cut -d ' ' -f 1| cut -d , -f 1 # Print hosts from ssh configuration file if [ -e ~/.ssh/config ]