Good morning folks,
I have to do this for my class assignment and I don't quite grasp how to.
The script will ask the user for two separate statements which will fill two variables, L and C. I need to check if L and C, both, are between the range from 1 to 3. If either L or C has a value lower than 1 and/or higher then 3 (outside the range), the script has to print a warning and ask for new values.
printf "Please, enter L and C: " read L C while [[ $L -ge 1 -a $L -le 3 ]]; do while [[ $C -ge 1 -a $C -ge 3 ]]; do
This works as intended (the loop). Is there any way to better handle this?