I have a variable FOO
with me that needs to be assigned with a value that will be multiple lines. Something like this,
FOO="This is line 1
This is line 2
This is line 3"
So when I print the value of FOO
it should give the following output.
echo $FOO
output:
This is line 1
This is line 2
This is line 3
Furthermore, the number of lines will be decided dynamically as I will initialize it using a loop.
The answers that have been shown in the other question using mainly read -d
is not suitable for me as I am doing intensive string operations and the code format is also important.