16 lines
313 B
Bash
16 lines
313 B
Bash
#!/bin/sh
|
|
|
|
hosts() {
|
|
if [ ! -r "$HOME/.ssh/config.d/hosts.conf" ]; then
|
|
printf '%s\n' 'SSH host configuration is unavailable.' >&2
|
|
return 1
|
|
fi
|
|
|
|
awk '
|
|
tolower($1) == "host" {
|
|
for (field = 2; field <= NF; field++) {
|
|
if ($field !~ /[*?!]/) print $field
|
|
}
|
|
}
|
|
' "$HOME/.ssh/config.d/hosts.conf"
|
|
}
|