From 1270384ede4ec1963c4a45e4083dabcc0cfabd87 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 29 Mar 2014 11:46:45 +0100 Subject: Fixed appearance of ssh hostnames with [] in them refs https://github.com/fish-shell/fish-shell/issues/1355 --- share/functions/__fish_print_hostnames.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish index dd62b5c8..1e9f8143 100644 --- a/share/functions/__fish_print_hostnames.fish +++ b/share/functions/__fish_print_hostnames.fish @@ -14,7 +14,7 @@ function __fish_print_hostnames -d "Print a list of known hostnames" # Print hosts with known ssh keys # Does not match hostnames with @directives specified - sgrep -Eoh '^[^#@|, ]*' ~/.ssh/known_hosts{,2} ^/dev/null + sgrep -Eoh '^[^#@|, ]*' ~/.ssh/known_hosts{,2} ^/dev/null | sed -E 's/^\[([^]]+)\]:([0-9]+)$/\1/' # Print hosts from system wide ssh configuration file if [ -e /etc/ssh/ssh_config ] -- cgit v1.2.3