Fixes #35530 - Make save_to_file macro safer (#9426)
save_to_file does
cat <<EOF >$file$contentEOF
but if `$content` contains a heredoc terminated with `EOF`, itterminates the heredoc that save_to_file creates.
This fix prefixes each line of $content with a space and then pipes theresult into sed to trim the one leading space away.
Fixes #35530 - Make save_to_file macro safer (#9426)
save_to_file does
cat <<EOF >$file
$content
EOF
but if `$content` contains a heredoc terminated with `EOF`, it
terminates the heredoc that save_to_file creates.
This fix prefixes each line of $content with a space and then pipes the
result into sed to trim the one leading space away.