Fixes issue #1234. Fish now parses system wide ssh configuration file in addition to user config.

This commit is contained in:
Alexander I.Grafov 2014-01-10 23:58:54 +04:00 committed by Siteshwar Vashisht
parent 2927514e68
commit 75b02e1d27

View File

@ -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