problem with nested if stament

hi everybody:
could anybody tell me what I'm doing wrong. I've tried to nest if staments like this:

if [condition1]; then
   if [condition2];then
        if [condition3];then
             commands
       else
             commands
       fi
   elif [condition4];then
             commands
   fi      
fi

and the last fi (end stament ) appears like missing.
[: 271: missing ] -----> this is the code line
Thanks in advance. :smiley:

put whitespace between [ and condition1, also between condition1 and ]. Do this for all conditional statements and check again.

Actually I've done all brackets with spaces but into one those I forget it.:eek:
Thanks. :smiley:

shall we call this Shell trap for the unwary?