Help needed: legend problem in GMT6.1, Windows 10

Hello friends, I started using GMT early this year. I want to put this across concerning getting a legend on a map. I followed Examples 42 and 49. The legend does not plot if I pass the legend content in the script. It reports this error message: “<< was unexpected at this time”

However, the line below works if I use a file that contains the legend content:
gmt legend -DjLB+w1.7i/0.9i+o0.15i/0.13i -F+gwhite+p1p+c0.1c study_area_map_legend.txt

Is there a way around it so that it plots like in Examples 42 and 49? Below is the script I have:

 gmt begin study_area_map png

	:: Making some settings:
	gmt set FONT_ANNOT_PRIMARY 8p,Helvetica FONT_LABEL 10p MAP_ANNOT_OFFSET_PRIMARY 0.1c  FONT_TITLE 10p MAP_TITLE_OFFSET 0.1c
	
	:: Plotting the main map:
	gmt coast -R-155/62/-60/60 -JM6i -Wfaint -N1/0.2p -EGH,CG,CI,BJ,GA,GN,GQ,CM,GW,LR,NG,ST,SL,TG+gdarkbrown -Gbisque -Sazure1 -Da -Bpx60 -Bpy30 -BWSne -Lg25/-55+c30N+w5000k+f+l+ar -Td35/-42+w1.5c+l+f3
	gmt plot Depths.csv -Sc0.02c -Gblack 
	
	:: Plotting an inset:
	gmt inset begin -DjLT+w3.5i/2.8i+o0.15i/0.1i -F+gwhite+p1p+c0.1c+s
		gmt set MAP_ANNOT_OFFSET_PRIMARY -0.1c		
		gmt coast -R-17/6/-6/12 -JM? -Wfaint -N1/0.1p -EGH,CI,BJ,GN,GW,LR,NG,ST,SL,TG+gdarkbrown -Gbisque -Sazure1 -Df -Bag -BWSne
		gmt plot Depths.csv -Sc0.03c -Gblack				
	gmt inset end
	
	:: Plotting the legend:
	gmt legend -DjLB+w1.7i/0.9i+o0.15i/0.13i -F+gwhite+p1p+c0.1c << EOF (fails to plot)	
	H 10p,Helvetica Legend
	S 0.15i c 0.1i black 0.25p 0.3i Depth point
	S 0.15i - 0.2i black 0.45p 0.3i National boundary
	S 0.15i s 0.2i azure1  0.25p 0.3i Ocean
	S 0.15i s 0.2i bisque  0.25p 0.3i Continent
 	S 0.15i s 0.2i darkbrown  0.25p 0.3i Countries of interest
	EOF
	
gmt end show

Sorry for the long post.

I am unaware that :: is an allowable comment in a bash script? Perhaps you are not using bash but some other script in which the “here document” notion of << marker is not supported? As far as I know, “here document” is not supported in windows batch scripts.

Thank you very much @pwessel for the clarification. You’re right I’m not using bash. I’m using a batch script. Now I know for sure << doesn’t work in batch scripts.