Do manual do bash :
Here Documents
The format of here-documents is:<<[-]word here-document delimiter
[...] If any characters in word are quoted, the delimiter is the result of quote removal on word, and the lines in the here-document are not expanded. If word is unquoted, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion.
Vamos tentar:
$ i='Howdy!'
$ ssh user@localhost /bin/bash << EOF
for i in {1..10}
do
echo $i
done
EOF
Howdy!
Howdy!
Howdy!
Howdy!
Howdy!
Howdy!
Howdy!
Howdy!
Howdy!
Howdy!
$ ssh user@localhost /bin/bash << 'EOF'
for i in {1..10}
do
echo $i
done
EOF
1
2
3
4
5
6
7
8
9
10
$