I have this:
echo `cat << 'EOF'
select c1, c2 from foo
where c1='something'
EOF`
it logs this to stdout:
select c1, c2 from foo where c1='something'
but I am looking to preserve newlines somehow, so it outputs:
select c1, c2 from foo where c1='something'
How can I do that?
Use double quotes with echo
to preserve the original format of the string.
echo "`cat << 'EOF'
select c1, c2 from foo
where c1='something'
EOF`"