syntax error: unexpected end of file

Hi,
I have problem in constructing "IF" condition.

The below code throws "tst.sh: line 10: syntax error: unexpected end of file"

#!/bin/ksh
test=9
echo $test
if [[$test -eq 9]]
then
  echo "in"
fi
echo "end"
exit 0

Actually, i want to check whether the variable $test is empty or null.

Any help on this is appreciated.

thanks,
tinku

first put space after [ in

if [[$test -eq 9]]

and before the last...

second...replace fi by else and place fi after

echo "end"

---------- Post updated at 03:03 AM ---------- Previous update was at 03:02 AM ----------

then
echo "in"
else
echo "end"
fi
exit 0
t=""
if [[ -n "$t" ]]
then 
echo "Not Null"
else 
echo "Null" 
fi

when t="" the condition is false and will echo "Null" and so on.

BR

In addition to good points made by others.
"test" is the name of a unix command.
Avoid using it in script names and environment variables.

type test
test is a shell builtin.

Thank you all.

I need one more information... i do not have a else condition
so, no need for fi

<code>
if condition
then
statements
</code>

Thanks,
tinku

Any way u need fi to end the if. (It is the syntax, whether else is there or not doesn't matter.)