I am trying to have a script give me the output of multiple words and variations of the words. I tried putting in the -o for the variable, quoting the words, piping them together. The words for each varname are the indicated words that I want to have output to me. Is there a way to correct this, or does each variable need to be set individually? Such as varname1=even varname2=Even varname3=EVEN, etc.
#!/bin/bash varname1=even -o Even -o EVEN varrname2=odd -o Odd -o ODD varname3=zero -o Zero -o ZERO varname4=negative -o Negative -o NEGATIVE # Ask the user for one of four select words echo "Type one of the following words:" echo "even, odd, zero, negative" read varword if [[ ("$varword" = $varname1 ) || ("$varword" = $varname2 ) || ("$varword" = $varname3 ) || ("$varword" = $varname4 ) ]] then echo "The approved word you have selected is $varword, great work! " else echo "The unapproved word you have selected is $varword, Please try again." fi