update
This commit is contained in:
parent
97d53308df
commit
2ac0f22dba
12 changed files with 346 additions and 10 deletions
18
hosts.sh
Normal file
18
hosts.sh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
# List the concrete destinations defined by the user's SSH configuration.
|
||||
|
||||
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"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue