NL=$'\n'
CMD=""
CMD="$CMD echo Hello ; $NL"
CMD="$CMD echo World ; $NL"
$CMD
The above code gives the following output, the echo
globing everything after it.
Hello ; echo World ;
Neither the new line character nor the semicolon does work here. What is going wrong?