aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-05-28 12:56:15 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-05-28 12:59:15 +1200
commit8b398553a6d6667c004b5fd2125501613471a2b5 (patch)
tree442b99ffd4f76cac2695acdf25b7a2e0ca3db04c /bin
parentResolve issue (diff)
downloaddotfiles-8b398553a6d6667c004b5fd2125501613471a2b5.tar.gz
dotfiles-8b398553a6d6667c004b5fd2125501613471a2b5.zip
Add mw(1df)
Diffstat (limited to 'bin')
-rw-r--r--bin/mw.awk10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/mw.awk b/bin/mw.awk
new file mode 100644
index 00000000..f51b8272
--- /dev/null
+++ b/bin/mw.awk
@@ -0,0 +1,10 @@
+# Crude approach to get alphabetic words one per line from input, not sorted or
+# deduplicated
+BEGIN {
+ RS = "(--|['_-]?[^[:alnum:]'_-]+['_-]?)"
+}
+{
+ for (i = 1; i <= NF; i++)
+ if ($i ~ /[[:alpha:]]/)
+ print $i
+}