I want an if statement in my bash script that does:
if [[ "$v" == "A" || my_func $x $y ]] ; then
but I get the error "conditional binary operator expected". I've tried putting quotes round the parameters in the call to my_func, but still no good. Tried playing around with eval, which didn't help either.
Thanks for any help.
[[ ]]is not part of if syntax;iftakes a command, and[[happens to be a builtin which can act as a comand, but not all things passed toifneed to be within[[ ]]-- only tests and non-numeric comparisons (numeric comparisons should use(( ))).