Suppose that there are three possible values for the variable Bash $x: foo, barand baz. How to write an expression to determine if $xone of these values is? In Python, for example, you can write:
x in ('foo', 'bar', 'baz')
Is there a Bash equivalent, or do three comparisons need to be done? Again, in Python you can write:
x == 'foo' or x == 'bar' or x == 'baz'
What is the correct way to express above in Bash?
source
share