Use a here-document (or function that returns a here-document) rather than a patch.