bash - comparing a variable to several values
I've written a script which I want to check for valid input:
dom_option="";
while [ "$dom_option" != [s,r,q,c] ]; do
echo "Choose (s)tart, (r)estart, (q)uit server or (c)ancel."
read dom_option
done
What should I put where I've presently got s,r,q,c so it only accepts one of these values before exiting the loop? Do I have to put four 'or' statements in my comparison?
I know I've read the syntax somewhere, but can't find it...
Dave
|