From e3f67d934025ba0c6853e8b8cdaddb97dbac1283 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 25 Dec 2011 17:19:45 -0500 Subject: rename `hangman' to `hangman-helper' to avoid conflict with bsd-games --- hangman-helper.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 hangman-helper.sh (limited to 'hangman-helper.sh') diff --git a/hangman-helper.sh b/hangman-helper.sh new file mode 100644 index 0000000..5e0e138 --- /dev/null +++ b/hangman-helper.sh @@ -0,0 +1,15 @@ +#!/bin/sh +word=$1 +not=$2 +flag=$3 + +temp=`mktemp` + +grep -i '^'"$word"'$' /usr/share/dict/words | grep -iv "['$not]" > "$temp" + +if [ "$flag" = '-l' ]; then + cat "$temp" | tr 'A-Z' 'a-z' | sed 's/\(.\)/\1\n/'g | sort | uniq -c | sort -n +else + cat "$temp" +fi +rm "$temp" -- cgit v1.2.3