From 06d3040a5a4d92d9a8da6509ee2494410ec5ea4a Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Mon, 17 Jan 2022 14:14:26 +0100 Subject: [PATCH] Shell script thing --- prog2/wordle/thing.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/prog2/wordle/thing.sh b/prog2/wordle/thing.sh index 6bf0c83..444b92f 100755 --- a/prog2/wordle/thing.sh +++ b/prog2/wordle/thing.sh @@ -2,6 +2,14 @@ words=/usr/share/dict/words +if [ -z "$2" ] +then + echo "Usage: $ thing.sh (lower bound) (upper bound)" + echo "Example: $ thing.sh 0 1" + echo "The above example will output the best words that match first and second characters." + exit +fi + thing=$(ruby calc.rb $1 $2) fivewords=$(cat $words | awk '{print tolower($0)}' | grep -E '^[[:alpha:]]{5}$')