./CARE_SM_SFTP.sh[27]: put: not found error while doing sftp

Hi,

I am getting the below error while doing sftp in a script file but the same is getting executed when i run from command prompt

./CARE_SM2_SFTP.sh[27]: put:  not found

Code :-

sftp ${USER_ID}@${FTPHOST4}:/opt/path
put <Filename with path>
chmod 777 <FileName with Path>
quit
EOF
 

Error :-

./CARE_SM2_SFTP.sh[27]: put:  not found
./CARE_SM2_SFTP.sh[29]: quit:  not found
./CARE_SM2_SFTP.sh[30]: EOF:  not found

Please help me know the exact reason for this error ,Last week everything is working fine.

Thanks & Regards,
Satish.

Hi,
In your script, missing <<EOF :

sftp ${USER_ID}@${FTPHOST4}:/opt/path <<EOF
put <Filename with path>
chmod 777 <FileName with Path>
quit
EOF

Regards.

yes disedorgue ,Corrected.

Thanks,
Satish.