f-secure sftp in shell script

Hi,

I am trying to use sftp in a ksh - Shell script, but not even a simple script like this returns not output:

sftp username@remotehost <<END
ls

END

If I do something like this:

sftp username@remotehost <<END | tee logfile
ls

END

I get this error message:
Warning: tcgetattr failed in ssh_rl_set_tty_modes_for_fd: fd 1: Not a typewriter
SshReadLine/sshreadline.c:2084: Setting tty modes failed.

This works fine with open ssh , but not with f-secure ssh.
Anybody an idea were the problem could be ?
May this be a configuration problem auf the f-secure ssh ?

OK , I made it know with a given temporary file. This works like this:

echo "ls" > $tmp/sftpcmd
sftp -B $tmp/sftpcmd username@remotehost
rm $tmp/sftpcmd