How to pass the variable value in echo statement?
testvar="actualvalue"
echo 'testing "${testvar}", "testing", "testing" ;'
Expected output:
testing "actualvalue", "testing", "testing" ;
But, I am getting the below output:
testing "${testvar}", "testing", "testing" ;
Can someone help me with this?
echo
command remove the special meaning of $. Replace the single quotes with double quotes, and put backslashes before the other double quotes:echo "testing \"${testvar}\", \"testing\", \"testing\" ;"
.