aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_print_hostnames.fish
diff options
context:
space:
mode:
authorGravatar Greg Dietsche <Gregory.Dietsche@cuw.edu>2013-04-01 16:42:40 -0500
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-04-03 18:45:13 -0700
commitd38f1380e9f294dfe587190e1591b8fd409c7366 (patch)
tree900aa1bf8731f69d6e3227b89ec90f25c45da77e /share/functions/__fish_print_hostnames.fish
parent2626b83b085f2a827d441d6c58be3ecb185d02be (diff)
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 <Gregory.Dietsche@cuw.edu>
Diffstat (limited to 'share/functions/__fish_print_hostnames.fish')
-rw-r--r--share/functions/__fish_print_hostnames.fish2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish
index 0f3facbb..7e4c23bf 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 ]