From 133ba6e01b5fe1fc87d0278300af9c367653c4b9 Mon Sep 17 00:00:00 2001 From: Michael Stillwell Date: Thu, 23 Jan 2014 14:59:19 +0000 Subject: [PATCH] Ignore "host", "hostname", and hostname wildcards See the PATTERNS section of ssh_config(5) for wildcards supported by ssh. --- share/functions/__fish_print_hostnames.fish | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish index 1e9f81433..1ad431515 100644 --- a/share/functions/__fish_print_hostnames.fish +++ b/share/functions/__fish_print_hostnames.fish @@ -18,13 +18,11 @@ function __fish_print_hostnames -d "Print a list of known hostnames" # 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' + sgrep -Eoi '^ *host[^*]*$' /etc/ssh/ssh_config | cut -d ' ' -f 2 | tr ' ' '\n' | sgrep -v '[\*\?\!]' 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' + sgrep -Eoi '^ *host[^*]*$' ~/.ssh/config | cut -d ' ' -f 2 | tr ' ' '\n' | sgrep -v '[\*\?\!]' end end