aboutsummaryrefslogtreecommitdiff
path: root/bin/shoal
blob: 469ce487abc791a0670cacfb80ceeee08b7dfde2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

#
# shoal(1) -- Print all the non-wildcard Host names (first
# one per line) from an ssh_config(5) file, defaulting to
# $HOME/.ssh/config.
#
# Author: Tom Ryder <tom@sanctum.geek.nz>
# Copyright: 2014
# License: Public domain
#

prog='$1 == "Host" && $2 !~ /[^a-z0-9_-]/ {print $2}'
awk "$prog" "${1:-$HOME/.ssh/config}"