Hello,
I have stared at this script for the last two days and am unable to find the cause of my error message. Any help would be greatly appreciated.
The script is
#!/bin/sh
for i in '/xxx/*'
do
if [ -f /xxx/$i ]
then
HOST='xxx.xxx.com'
USER='xxxx'
PASSWD='xxxx'
FILE='$i'
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
ascii
put $FILE
END_SCRIPT
fi
done
I have removed some of the site specifics but this is the basic script. If I remove the For loop and If condition and just specify the file name, the ftp works. Introduction of the loops causes:
uploader.sh: 19: Syntax error: end of file unexpected (expecting "fi")
each time. The error is always listed as one line past the length of the script. I am completely baffled as to what I am missing in this script.