SFTP connection using shell script

Hi ,
I am able to manually connect to remote system usning "sftp" protocol. But when I using the below command in the script but I am not able to connect.

`sftp TEST01@120.34.3.4`

And the connection should not be closed after login. Please help to solve this.

Thanks
Satya

can you include the other part of the script? If you are using a file or here document as input or is it supposed to be passwordless sftp or you have to input it manually when your script prompts for it.

for non-interactive mode try

lftp -u user_name,password sftp://120.34.3.4/your/path/location/<< EOF
ls
bye
EOF

But this is bad idea.. cause password is shown in script