Linux scripting problem using ps command

when I try to apply this principle to my script, is not working, it tells me something like 'command not found'

what i wrote is this..

if [$(ps -u $(id -u) | wc -l) -lt 5];
then echo "message1";
else echo "message2"; fi

I'm supposed to count number of processes of the user, and if they're five or more, then a message must come up.. when i use both commands alone, is working without problem..

:eek: what am i doing wrong? (oh by the way, is Linux platform)

if [ $(ps -u $(id -u) | wc -l) -lt 5 ];

Spaces are required in both side.

Double post.

Continued here.