Sample Header Ad - 728x90

Interpolate within single quotes

3 votes
2 answers
6748 views
I have the following: COMMENT="A random comment" TEXT_JSON='{"person" : "Jim","comment" : "$COMMENT"}' echo "$TEXT_JSON" | jq . This prints { "person": "Jim", "comment": "$COMMENT" } which is not what I want. How can I interpolate the string here?
Asked by Jim (1479 rep)
Jun 5, 2018, 11:16 AM
Last activity: Oct 22, 2024, 09:01 AM