I have an input in my script that writes to a file needed to run some software, however the software only allows for one of 2 possible options, namely LO and LDO.
The input I already have written is at the top of the following code, and the code at the bottom is the code that was suggested that I want to manipulate
I would like to have the question "Overlap (LO or LDO): " and an error message if one of those options arent entered and to repeat that step, instead of going through the whole script again, rather than searching for values between 0 and 9
from what i can gather, I need to change the ^[0-9] to include LO and LDO, but I am not sure what punctuation or how to do it
### My Script ### read -p "Overlap (LO or LDO): " OVERLAP ### Recommended Script ### #!bin/bash number="" while [[ ! $number =~ ^[0-9]+$ ]]; do echo Please enter your age read number done echo You are $number years old