SFTP Shell Script from a Unix server to another

I am facing a typical issue for transfering files through secured FTP (SFTP)

for example, i have three different servers a,b & c
server A - where data file resides
Server B - where Unix shell program resides here(source server)
server C - Destination server

I wanted to run the shell program from Server B which fetches the data file from server A and then transfer it to Server C.

Is there any way of transferring the file directly from Server A to Server C using SFTP?

I am facing this issue because the shell program is in the application tier (which is server B in above example) and our extract program creates data file in the database server (server A in the above example) and we need to SFTP this file to a destination third-party server (server C in the above example).

Please advice.Any sample scripts would be helpful.
Thanks
Madhu

Please don't double post or bump threads, it is against the forum's rules. I have answered you in your original thread, here. I've posted sample code, the rest is up to you. While I understand you may have urgent task, it takes ~ 1 hour to understand Expect and complete the whatever task you want.