summaryrefslogtreecommitdiff
path: root/dicewords
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2016-05-19 21:04:56 +0200
committerPeter Palfrader <peter@palfrader.org>2016-05-19 21:04:56 +0200
commit70d53d9a7584740de01cd749c87574ca60059892 (patch)
tree1cdb79df246cae300102316f15234a31400ffd6a /dicewords
parent1a06cdc887ec1ac4da7af9948a4fb7723df0f76d (diff)
add dicewords
Diffstat (limited to 'dicewords')
-rwxr-xr-xdicewords11
1 files changed, 11 insertions, 0 deletions
diff --git a/dicewords b/dicewords
new file mode 100755
index 0000000..3a450fa
--- /dev/null
+++ b/dicewords
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+count=${1:-6}
+
+if [ "$count" = "-h" ]; then
+ echo "Usage: $0 [count]"
+fi
+
+egrep '^[a-z]{1,6}$' /usr/share/dict/american-english | shuf | head -n "$count" | tr '\n' '-' | sed -e 's/-$//'
+echo
+