arreglos y función showerrors

master
fanta 2 years ago
parent edcc712589
commit b4c8924ac6

@ -1,7 +1,19 @@
#!/bin/bash
# grep -iEw "n..io" palabras.txt
# fanta <fanta@56k.es>
# Helper script to find words in the spanish worlde version
wordList="words-es.txt"
function showError(){
echo "[Error] $1"
}
if [ -z "$1" ]; then
echo "Mete el parametro. Ejemplo: wordle.sh n..io . Siendo los puntos lo que desconoces."
showError "Example: wordle.sh n..io (The dots are the unknown characters)"
else
grep -iEw "$1" palabras.txt
if [ $(echo -n "$1" | wc -m) -le 5 ]; then
grep -iEw "$1" $wordList
# la salida tendria que ser de palabras solamente con 5 caracteres
else
showError "Too many characters my friend. They must be 5"
fi
fi

Loading…
Cancel
Save