I'm echoing a heredoc into a file, but the line breaks are being lost
Running this script
#!/bin/bash NAME="$1" mkdir -p $NAME FILE=$(cat <<SETVAR name = "$NAME" type = "test" SETVAR ) echo $FILE > $NAME/$NAME.txt
With the arg: foo, results in the file at foo/foo.txt containing
name = "foo" type = "test"
Any ideas? Thanks