This
STR=\"Hello\\nWorld\" echo $STR
produces as output
Hello\\nWorld
instead of
Hello Wo
What I did based on the other answers was
NEWLINE=$'\n' my_var="__between eggs and bacon__" echo "spam${NEWLINE}eggs${my_var}bacon${NEWLINE}knight" # which outputs: spam eggs__between eggs and bacon__bacon knight