I'm writing a bash script that first saves a text (with newline characters coming from grep
), and then prints it later. For some reason, the line echo $TEXT
prints just a single line. I took a look at this answer, and I believe I'm using the same thing (but with $() instead of backticks), but it's not working. Any ideas?
TEXT=$(grep Vacation vacations | grep Day)
echo "Counting days based on the following:"
echo "###############################################################"
echo $TEXT
echo "###############################################################"