I'm not sure exactly where that particular error comes from, but there are a couple of issues with this.

First, when comparing integers you'll want to use the '-eq' operator. Use '=' to compare strings. I think '==' won't work in some shells.

Second, your 'if' statement is enclosed in an extra set of [brackets]. Knock those off and we're one step closer!

Third, and I could be wrong about this, but 'if' won't do math for you. The way to express a math problem in bash is $((x+y)) (or $(($x+$y)) ).

The 'Advanced Bash Scripting Guide' on the tldp.org site is just about the best bash scripting reference out there. Here's a link to the page on operators:

Its working only one things we have to take care is bracket, because system does not understand the meaning of given statement if we put wrong bracket in wrong position, so we need to define if with OR logical operator are as follows

if [ $c -eq $((a+b)) ] || [ $c -eq $((a+d)) ]; then