diff options
author | Peter Palfrader <peter@palfrader.org> | 2016-05-19 21:04:56 +0200 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2016-05-19 21:04:56 +0200 |
commit | 70d53d9a7584740de01cd749c87574ca60059892 (patch) | |
tree | 1cdb79df246cae300102316f15234a31400ffd6a | |
parent | 1a06cdc887ec1ac4da7af9948a4fb7723df0f76d (diff) |
add dicewords
-rwxr-xr-x | dicewords | 11 |
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 + |