There is a comment in the POSIX Standard's rationale for the simple commands section of the shell command language description that says:
But, I don't see anything in the standard that clearly specifies for what a here-document without a command is providing input. With the command exec a here-document does replace standard input for the current shell execution environment.
Playing around a little bit with the above example code in the POSIX rationale and the code supplied in post #1 in this thread, it appears to me that the here-document:
<<comments
put ${pathforfiles}/${ftpfilename}
put ${logs}/${filename}.sch
put ${logs}/${filename}.tgr
comments
is a shell language comment similar to the C language comment:
/*
put ${pathforfiles}/${ftpfilename}
put ${logs}/${filename}.sch
put ${logs}/${filename}.tgr
*/
except that any expansions occurring in that here-document may have side effects. For example:
count=0
IFS=:
while read a b
do echo $a
<<comment
This comment counts lines read from the input file
$((++count))
comment
done </etc/passwd
echo "$count lines were read from /etc/passwd"
might produce abbreviated output similar to:
root
nobody
daemon
...
108 lines were read from /etc/passwd
If you wanted a multi-line shell comment without side effects (like the C example I showed earlier) you could quote one or more characters in the EOF string of the here-document:
count=0
IFS=:
while read a b
do echo $a
<<"comment"
This comment counts lines read from the input file
$((++count))
comment
done </etc/passwd
echo "$count lines were read from /etc/passwd"
which would then produce abbreviated output similar to the following (with the last line being exactly like that shown below):
root
nobody
daemon
...
0 lines were read from /etc/passwd