Article 5GKDZ literal string has a $ in front of it. How can I ignore it?

literal string has a $ in front of it. How can I ignore it?

by
aristosv
from LinuxQuestions.org on (#5GKDZ)
In a .json file, I am trying to replace the literal string $max_open_trades with a value that I have stored in the $max_open_trades variable. Unfortunately both have the same name, and even worst the literal sting has a $ in front of it.

Code:sed -i -e "s/$max_open_trades/$max_open_trades/g" /root/freqtrade_USDT/test/config.jsonObviously when using double quotes the shell tries to expand both variables and when using single quotes none of the variables are expanded.

Attachment 36109

Using sed, is there a way to consider the first instance of $max_open_trades as a literal string and the second as a variable to be expanded?

I don't know maybe I'm thinking about it all wrong, any suggestions are welcome.

Thanks
Attached Thumbnailsattachment.php?attachmentid=36109&stc=1& latest?d=yIl2AUoC8zA latest?i=2CiC9P2LUQs:Gwzp0gdc6oE:F7zBnMy latest?i=2CiC9P2LUQs:Gwzp0gdc6oE:V_sGLiP latest?d=qj6IDK7rITs latest?i=2CiC9P2LUQs:Gwzp0gdc6oE:gIN9vFw2CiC9P2LUQs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments