test with two conditions (OR)

Hi there,
I'm very surprised that I can't find this myself and I'm sorry to bother you with such a stupid question. I just want to write a test with one condition or another one. I want either the first argument to be equal to 'this' or the second argument to be equal to 'that'.

~$ cat test
(( $1='this' || $2='that' )) && echo test1 says ok
(( $1=='this' || $2=='that' )) && echo test2 says ok
[[ $1='this' || $2='that' ]] && echo test3 says ok
[[ $1=='this' || $2=='that' ]] && echo test4 says ok
~$ test wrong wrong
test: line 1: ((: wrong=this || wrong=that : attempted assignment to non-variable (error token is "=that ")
test2 says ok
test3 says ok
test4 says ok
~$ test this wrong
test: line 1: ((: this=this || wrong=that : attempted assignment to non-variable (error token is "=that ")
test2 says ok
test3 says ok
test4 says ok
~$ test wrong that
test: line 1: ((: wrong=this || that=that : attempted assignment to non-variable (error token is "=that ")
test2 says ok
test3 says ok
test4 says ok
~$ test this that
test: line 1: ((: this=this || that=that : attempted assignment to non-variable (error token is "=that ")
test2 says ok
test3 says ok
test4 says ok

To sum up those tests, first construct will never work, and other constructs will always return true.
Can you help me with that, I can't believe this can be hard!
Thanks in advance
Santiago

Hi,

try it this way:

( [[ $1 = this ]] || [[ $2 = that ]] ) && echo true || echo false

HTH Chris

Use square brackets instead of parenthesis and place a space around the equal signs:

[[ $1 == 'this' || $2 == 'that' ]] && echo test1 says ok
[[ $1 == 'this' || $2 == 'that' ]] && echo test2 says ok
[[ $1 = 'this' || $2 = 'that' ]] && echo test3 says ok
[[ $1 == 'this' || $2 == 'that' ]] && echo test4 says ok

Thanks Christoph Spohr and Franklin52,
Both your proposals work fine.