From 70c0690e56f8906296513c10a3cd4c37e63f742d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 26 Jan 2017 01:27:42 -0500 Subject: hangman-helper: improve --- hangman-helper.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hangman-helper.sh b/hangman-helper.sh index 3ed1c17..c46bb1e 100644 --- a/hangman-helper.sh +++ b/hangman-helper.sh @@ -7,7 +7,7 @@ # # Without the `-l` flag, it produces a list of possible completions. # -# With the `-l` flag, it produces a list of letters, +# With the `-l` flag, it produces a list of letters not in , # sorted by the number of times they appear in the normal list word=$1 @@ -16,8 +16,8 @@ flag=$3 grep -ix "$word" /usr/share/dict/words | grep -iv "['$not]" | { if [[ "$flag" = '-l' ]]; then - tr 'A-Z' 'a-z' | sed 's/\(.\)/\1\n/'g | sort | uniq -c | sort -n + tr 'A-Z' 'a-z' | sed 's/\(.\)/\1\n/'g | grep -v -e "[$word]" -e '^$' | sort | uniq -c | sort -n else - cat + sort fi } -- cgit v1.2.3-2-g168b