diff options
author | Michael Stillwell <mjs@beebo.org> | 2014-01-23 14:59:19 +0000 |
---|---|---|
committer | Konrad Borowski <x.fix@o2.pl> | 2014-09-16 17:20:59 +0200 |
commit | 133ba6e01b5fe1fc87d0278300af9c367653c4b9 (patch) | |
tree | 81239f2c2fbea953b127861f13cc643946105706 /share/functions/__fish_print_hostnames.fish | |
parent | 9bfb4f1e110ac2ac65df009cd00dc59e60c15337 (diff) |
Ignore "host", "hostname", and hostname wildcards
See the PATTERNS section of ssh_config(5) for wildcards supported by ssh.
Diffstat (limited to 'share/functions/__fish_print_hostnames.fish')
-rw-r--r-- | share/functions/__fish_print_hostnames.fish | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish index 1e9f8143..1ad43151 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 |