mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-10 04:41:15 -03:00
Ignore "host", "hostname", and hostname wildcards
See the PATTERNS section of ssh_config(5) for wildcards supported by ssh.
This commit is contained in:
committed by
Konrad Borowski
parent
9bfb4f1e11
commit
133ba6e01b
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user