mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 03:51:20 -03:00
@@ -26,9 +26,9 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
|
||||
if test -r $file
|
||||
# Print hosts from system wide ssh configuration file
|
||||
# Note the non-capturing group to avoid printing "name"
|
||||
string match -r '\s*Host(?:name)? \w.*' < $file | string replace -r '^\s*Host(?:name)?\s*(\S+)' '$1'
|
||||
set known_hosts $known_hosts (string match -r '^\s*UserKnownHostsFile|^\s*GlobalKnownHostsFile' <$file \
|
||||
| string replace -r '.*KnownHostsFile\s*' '')
|
||||
string match -ri '\s*Host(?:name)? \w.*' < $file | string replace -ri '^\s*Host(?:name)?\s*(\S+)' '$1'
|
||||
set known_hosts $known_hosts (string match -ri '^\s*UserKnownHostsFile|^\s*GlobalKnownHostsFile' <$file \
|
||||
| string replace -ri '.*KnownHostsFile\s*' '')
|
||||
end
|
||||
end
|
||||
for file in $known_hosts
|
||||
|
||||
Reference in New Issue
Block a user