I want to force people to pass a certain string after getting prompted:
while [[ ! ${task} =~ "up|down" ]]; do
echo $task
read -p "Task to conduct? [up|down] " input
task=$input
done
Although passing the correct string I am still getting the prompt:
Task to conduct? [up|down] down
down
Task to conduct? [up|down] up
up
Task to conduct? [up|down]
What do I miss?