Home:ALL Converter>Issue with running commands from shell script

Issue with running commands from shell script

Ask Time:2014-02-25T18:16:34         Author:Naresh

Json Formatter

I'm trying to copy files from a remote windows server to Unix server. I was successfully able to copy files from windows server using command prompt but when I run these commands from a script it's not working as expected.

commands used:

sftp [email protected]

lcd local_dir

cd remote dir

get file_name

exit

When I run these commands from a script the script is stopping after it connects to the remote server.

Can anybody tell me how to fix this issue.

Author:Naresh,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/22011043/issue-with-running-commands-from-shell-script
yy