How to preserve line breaks when storing command output to a variable?

I’m using bash shell on Linux. I have this simple script … #!/bin/bash TEMP=`sed -n “””Starting deployment of”‘/,/'”Failed to start context”‘/p’ “/usr/java/jboss/standalone/log/server.log” | tac | awk “””Starting deployment of”‘/ {print;exit} 1’ | tac` echo $TEMP However, when I run this script ./ all the output is printed without the carriage returns/new lines. Not sure if … Read more