Automating sftp using IBM AIX(UNIX) shell script
问题 I am trying to automate my SFTP command using a UNIX shell script but for some reason it doesn't work. Here is my code as below. Please share your thoughts/insights. #This ftp script will copy all the files from source directory into the local directory. #!/bin/sh HOST='sftp.xyz.com' USER='ABC' PASSWORD='123' SRC_DIR='From_Src' TRGT_DIR='/work/' FILE='abc.txt' sftp -u ${USER},${PASSWORD} sftp://${HOST} <<EOF cd $SRC_DIR lcd $TRGT_DIR get $FILE bye EOF echo "DONE" When I try executing the