I´m trying to create a file using
cat - << EOF > file.sh
But inside this, I want to write another EOF. Its hard to explain, so here an example:
cat - << EOF > file1.sh
echo first
cat - << EOF > file2.sh
echo second
EOF
echo again first
EOF
But of course, at line 5 it breaks. It does not create file1.sh with the content line 2-6, but with the content line 2-4.
EOF
".