Pectus Excavatum Pectus Excavatum - 1 month ago 10
Bash Question

shell bash, how to echo variables inside single quotes

I am just wondering how I can echo a variable inside single quotes (I am using single quotes as the string has quotation marks in it).

echo 'test text "here_is_some_test_text_$counter" "output"' >> ${FILE}


any help would be greatly appreciated

Answer

You can't.

 echo 'test text "here_is_some_test_text_'"$counter"'" "output"' >> ${FILE}
Comments