Skip to content

Commit

Permalink
Fixes issue #1234. Fish now parses system wide ssh configuration file…
Browse files Browse the repository at this point in the history
… in addition to user config.
  • Loading branch information
grafov authored and siteshwar committed Jan 12, 2014
1 parent 2927514 commit 75b02e1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion share/functions/__fish_print_hostnames.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 75b02e1

Please sign in to comment.