This should work. Note protecting the parentheses in the "if" statement, enclosing strings in double quotes, and using single square brackets. Note spelling "crocodile" the same way in $b !
#!/bin/ksh
a="rhino"
b="crocodile"
c="testsc"
if [ \( "$a" = "rhino" -o "$b" = "crocodile" \) -a "$c" = "testsc" ]
then
echo "Test #5 succeeds."
else
echo "Test #5 fails."
fi
Mine and franklin52 solutions look similar but are actually very different.
franklin52 is using a "regular expression" - see "man 5 regexp" (and "man" for your shell) within a sub-shell (enclosed by parentheses) and testing the success or failure with the "&&" operative before using a "test" for the right hand side of the and.
I am just using a "test" - see "man 1 test" (and "man" for your shell) with parentheses overriding the default execution order of the ands and ors. Similar to a mathematical function. The parentheses are escaped so they will be passed to "test" rather than being actioned by the shell.
Thus the use of parentheses is totally different syntax, but the use of single square brackets to enclose a condition is similar.
IMHO the OP wants to test this condition (in C style):
if (( "a" == rhino || "b" == crocodile ) && "c" == testsc )
The order of the test statements is significant, in the examples above the parentheses doesn't matter, but check the output of these commands:
$ bash --version
GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
$
$
$ if [ "a" = "b" ] && ([ "b" = "b" ] || [ "a" = "a" ]); then echo YES; fi
$
$ if [ "a" = "b" ] && [ "b" = "b" ] || [ "a" = "a" ]; then echo YES; fi
YES
$