In Unix, I need an input validation which use grep:
echo $INPUT| grep -E -q '^foo1foo2foo3' || echo "no"
What I really need is if input doesn't match at least one of these values: foo1
foo2
or foo3
, exit the program.
Source: syntax is taken from Validating parameters to a Bash script