HI
My doubt may be basic one but I need to get it clarified..
When i use "if" condition that checks for many AND, OR logical conditions
like
if [[ $Set -eq 2 && $pe = "$Msg" || $pe = "$pa" || $pe = "$mat" && $port -eq 2 && $new -eq 2 && ue -eq 0 ]]; then
return 0
fi
Even the if condition fails it returns as zero.. Any clue..
But if i add else condition like
if [[ $Set -eq 2 && $pe = "$Msg" || $pe = "$pa" || $pe = "$mat" && $port -eq 2 && $new -eq 2 && ue -eq 0 ]]; then
return 0
else
return 4
fi
It works as expected.. But my doubt is why does if statement alone wont work??
Is it mandatory to add "else" statement in ksh shell whenever "if" is used?