variables not assigning in a function

Hi GUYS,

I have function. I am assigning a line count to count variable. But it is throwing an error at this line.

function_recur (){
#file being created in this function

lenth = `wc -l function_outpu.dat`;
echo $lenth;
}

this is the error i got

rec.ksh[11]: lenth:  not found.

Please help me in resolving it..

Thanks for your help in advance.

Regards,
Magesh.

When assigning values to variables then don't use spaces between the variable name, the equal symbol and the value:

Wrong:

lenth = `wc -l function_outpu.dat`;
     ^ ^

Correct:

lenth=`wc -l function_outpu.dat`

You can also leave out the ; at the end since it is used in shell to separate commands if they are written in the same line.

Not an important typo but I guess you wanted to write length instead of lenth.

Remove the spaces...

lenth=`wc -l function_outpu.dat`;

thanks. tat solved the problem..