I have the below sftp script to transfer a file from a linux host(source) to another linux host(target). Public key is already set up in target host and I am able to transfer file using sftp from source to target.
But not sure why the below script(ftp_script) is not working.
Any help in this regard will be highly appreciated.
#!/bin/ksh
sftp user2@target <<!
put test.txt
quit
!
Below is the output from console after running the script
[user1@source ~]$./ftp_script
Remote system type is POSIX\
sftp>
[user1@source ~]$