in reply to How to generate files based on some special character?

Or (just for kicks):

perl -pe"s/^</#EOF\ncat<<'#EOF'>/" large_file | sh