|
|
Question : Shell script logical operators
|
|
I want to write something like this in a korn shell script
if [ "_$ClientBox" = "_" || "_$RecBox" = "_" || ("_$post1" = "_" && "_$post2" = "_") ]
This syntax gives an error. Please advise.
|
Answer : Shell script logical operators
|
|
The parentheses would be a problem too :-(
Better to use the [[ ]] test operator in ksh. Takes care of both problems.
I.e. if [[ "_$ClientBox" = "_" || "_$RecBox" = "_" || ("_$post1" = "_" && "_$post2" = "_") ]]
|
|
|
|