I have the following code:
startCmnd="sudo -- bash -c"
test="${startCmnd} \"echo 'Hello this is a \$TEST' >> hello.txt\""
bash -c "${test}"
The expected result must be the text Hello this is a $TEST inside the file, but instead of that, it only put Hello this is a.
It has to be done in that way
Does anyone has any idea of how I fix this or a better way to accomplish this?
Any help it would be preciated
\\\$TEST. – Kusalananda Mar 16 '20 at 08:45