aboutsummaryrefslogtreecommitdiff
path: root/bin/shoal
diff options
context:
space:
mode:
Diffstat (limited to 'bin/shoal')
-rwxr-xr-xbin/shoal15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/shoal b/bin/shoal
new file mode 100755
index 00000000..469ce487
--- /dev/null
+++ b/bin/shoal
@@ -0,0 +1,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}"
+