linux set multiline variable
# in a bash script the following works:
#!/bin/sh
text="this is line one\nthis is line two\nthis is line three"
echo -e $text > filename
# alternatively:
text="this is line one
this is line two
this is line three"
echo "$text" > filename
# cat filename gives:
this is line one
this is line two
this is line three