Fixed appearance of ssh hostnames with [] in them

refs https://github.com/fish-shell/fish-shell/issues/1355
This commit is contained in:
Knut Ahlers 2014-03-29 11:46:45 +01:00
parent aa1b065dd1
commit 1270384ede

View file

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