problem with if in shell

Hi,

My sheel script has below statement:

if[ ! -z "`ps -fp $PID -o pid=,command=`" ]; then
When I run iam getting the below error:

-bash: syntax error near unexpected token `then'

What is wrong with that statement:

Plz help me.

Hi,

I got the problem.

I did not give the space, between if & [.

Now the script is working.

Thank. you.

Sometimes a syntax error earlier in the script produces an error message on an unrelated line later in the script.

Without seeing more, or understanding what that one lines does, that would be my guess.