aboutsummaryrefslogtreecommitdiff
path: root/bin/shoal
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-05-02 14:32:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2014-05-02 14:32:12 +1200
commitb8edd5536e9f824d75ac44bb57058b656e351535 (patch)
treedb785b79565667dd51b4135d87904accf7b20d05 /bin/shoal
parentRemove redundant export call for PATH (diff)
downloaddotfiles-b8edd5536e9f824d75ac44bb57058b656e351535.tar.gz
dotfiles-b8edd5536e9f824d75ac44bb57058b656e351535.zip
Add scatter(1), shoal(1), and shock(1)
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}"
+