From 75b02e1d274bf5d74f3aa37936495fbe4378ec60 Mon Sep 17 00:00:00 2001 From: "Alexander I.Grafov" Date: Fri, 10 Jan 2014 23:58:54 +0400 Subject: [PATCH] Fixes issue #1234. Fish now parses system wide ssh configuration file in addition to user config. --- share/functions/__fish_print_hostnames.fish | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish index 2c737a69a..dd62b5c87 100644 --- a/share/functions/__fish_print_hostnames.fish +++ b/share/functions/__fish_print_hostnames.fish @@ -16,10 +16,15 @@ function __fish_print_hostnames -d "Print a list of known hostnames" # Does not match hostnames with @directives specified sgrep -Eoh '^[^#@|, ]*' ~/.ssh/known_hosts{,2} ^/dev/null + # Print hosts from system wide ssh configuration file + if [ -e /etc/ssh/ssh_config ] + # Ignore lines containing wildcards + sgrep -Eoi '^ *host[^*]*$' /etc/ssh/ssh_config | cut -d '=' -f 2 | tr ' ' '\n' + end + # Print hosts from ssh configuration file if [ -e ~/.ssh/config ] # Ignore lines containing wildcards sgrep -Eoi '^ *host[^*]*$' ~/.ssh/config | cut -d '=' -f 2 | tr ' ' '\n' end end -