write multiline string to file bash code example
Example 1: shell write multiple lines to file
#!/bin/bash
cat > /path/to/myfile <<EOL
write whatever youwant
with multiple lines
...
EOL
Example 2: bash multiline ech
cat <<EOT >> my_file.txt
my text line 1
my text line 2
EOT