script error

Hi All,
I am trying to run the file A. But i am facing the following error.

./A.sh: line 13: syntax error near unexpected token `fi'
./A.sh: line 13: `fi'

File A:
if [$#==1] then
/m01/oracle/6iprod/compile/scripts/hforms.sh $1
else
/m01/oracle/6iprod/compile/scripts/hforms.sh
fi

File hforms.sh:
if [$#==0] then
for i in `ls *.fmb`
do
echo "Compiling Form $i \n"
/m01/oracle/product/9.0.4/bin/f90genm userid=a/b@unix.gna batch=yes module=$i module_type=form compile_all=yes
RET=$?
echo $RET
done
else
echo "Compiling Form $1 \n"
/m01/oracle/product/9.0.4/bin/f90genm userid=oe/temp1234@unix.gna batch=yes module=$i module_type=form compile_all=yes
RET=$?
echo $RET
fi

your suggestions would be of great help..

Use [ code ] tags please when displaying code, data or logs; the forum offers them.

...
if [$#==0] then
...

Better write all your if statements like:

if [[ $# == 0 ]]; then

When then is in the same line, then you have to put semicolon in front of it. Try again and see if the error still occurs.

Far better if you don't; that is non-standard syntax.

That problem is the lack of spaces and a missing semicolon or newline and, depending on the shell, possibly an incorrect operator. It should be:

if [ $# = 0 ]; then