Save output of command to variable bash by OUTPUT="$(ls -1)" echo "${OUTPUT}" MULTILINE=$(ls \ -1) echo "${MULTILINE}"OUTPUT="$(ls -1)" echo "${OUTPUT}" MULTILINE=$(ls \ -1) echo "${MULTILINE}" Please follow and like us: