How to write a varible into file in ksh

set filename $logDir/PyLog/$logname
echo $filename >> logname.txt

I am trying to write to write the varibale filename into a file logname.txt,it is not working could any one suggest y

In Korn Shell, use :

filename=$logDir/PyLog/$logname

or

export filename=$logDir/PyLog/$logname

Your syntax for setting the variable is wrong. Fix that, and you should be good to go.