18 lines
322 B
Bash
18 lines
322 B
Bash
|
#!/usr/bin/env bash
|
||
|
readWords() {
|
||
|
declare -i int="$1"
|
||
|
|
||
|
(( int == 0 )) && {
|
||
|
printf "%s\n" "$int is 0, cant find 0 words"
|
||
|
return 1
|
||
|
}
|
||
|
|
||
|
while read getWords;do
|
||
|
if [[ ${#getWords} -eq $int ]];then
|
||
|
printf "%s\n" "$getWords"
|
||
|
fi
|
||
|
done < /usr/share/dict/words
|
||
|
}
|
||
|
|
||
|
readWords 20
|