'how to use the bash variable in single quotes

I am having bash code like below

'payload={"text": "failure with ${VAR} failed for"}'

but the variable is not resolving to actual value Please don't put negative as I don't have that much experience in Bash so.



Solution 1:[1]

You can concatenate variables directly.

'payload={"text": "failure with '${VAR}' failed for"}'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 过过招