I want to append a multiline string while preserving whitespace to an existing variable.
final_str='$one'
tmp=$(cat << 'EOM'
$two
$three
EOM
)
final_str=${final_str}${tmp}
echo $final_str
Output:
$one $two $three
Expected output:
$one
$two
$three
How do I achieve this using nowdoc? Are there any simpler ways to do this?