Pectus Excavatum Pectus Excavatum - 1 year ago 101
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 Source

You can't.

 echo 'test text "here_is_some_test_text_'"$counter"'" "output"' >> ${FILE}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download