aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_print_hostnames.fish
diff options
context:
space:
mode:
authorGravatar Knut Ahlers <knut@ahlers.me>2014-03-29 11:46:45 +0100
committerGravatar Knut Ahlers <knut@ahlers.me>2014-03-29 11:46:45 +0100
commit1270384ede4ec1963c4a45e4083dabcc0cfabd87 (patch)
treec75b33a99ebc55ef4523d44695d3201935e55993 /share/functions/__fish_print_hostnames.fish
parentaa1b065dd1c03f7c0867d002badcf0dc88feb3c4 (diff)
Fixed appearance of ssh hostnames with [] in them
Diffstat (limited to 'share/functions/__fish_print_hostnames.fish')
-rw-r--r--share/functions/__fish_print_hostnames.fish2
1 files changed, 1 insertions, 1 deletions
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 ]