cat > script <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
let pagelength = 40;
header
	print "==============", newline;
	end;

footer
	if 1 = 1
		if 2 = 2
			print "--------------";
		else
			newline;
		end;
	else
		print "1 != 1 ???????";
		newline;
		end;
	print "####################";
	newline;
	end;

print "dummy";
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 755 script
cat > stdout <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
==============
dummy




































--------------####################

+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 stdout
cat > tag <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
nested ifs in footer, last without a newline, all followed by a newline
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 tag
