diff options
author | 2014-01-10 23:58:54 +0400 | |
---|---|---|
committer | 2014-01-12 14:59:46 +0530 | |
commit | 75b02e1d274bf5d74f3aa37936495fbe4378ec60 (patch) | |
tree | cc3ac6c47c558967004cfcbb7850e6001403144e /share | |
parent | 2927514e68f6fcbe8987644c4b0a09e9f821711c (diff) |
Fixes issue #1234. Fish now parses system wide ssh configuration file in addition to user config.
Diffstat (limited to 'share')
-rw-r--r-- | share/functions/__fish_print_hostnames.fish | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish index 2c737a69..dd62b5c8 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 - |