Hi,
I have a shell that spp to ftp to a host and get several files based on the filenames passed on command line.
For example: ksh script.sh file1 file2.txt file3.xls
for arg in "$@"
do
FILE=$arg
ftp -n -i -v <<SCRIPT
open $HOST
user $USER $PASSWD
cd $HOSTDIR
bin
get $FILE$DT$EXT
quit
SCRIPT
done
This works when the ftp code segment is ran outside of the loop, but when I have it within a loop like above, there is a syntax error at '<<' I don't understand why. Can someone please advise.
thanks.
I have a shell that spp to ftp to a host and get several files based on the filenames passed on command line.
For example: ksh script.sh file1 file2.txt file3.xls
for arg in "$@"
do
FILE=$arg
ftp -n -i -v <<SCRIPT
open $HOST
user $USER $PASSWD
cd $HOSTDIR
bin
get $FILE$DT$EXT
quit
SCRIPT
done
This works when the ftp code segment is ran outside of the loop, but when I have it within a loop like above, there is a syntax error at '<<' I don't understand why. Can someone please advise.
thanks.