I am trying to write a script in bash that check the validity of a user input. I want to match the input (say variable x) to a list of valid values.
x
You can use (* wildcards) outside a case statement, too, if you use double brackets:
string='My string'; if [[ $string == *My* ]] then echo "It's there!"; fi