I've searched a ton on this, but couldn't find what I was hoping to find. I want to use sed to replace some text in a config file. I've used it successfully before in situations without single quotes, but this time single quotes are part of the string that I want to insert into the file.
Here's the command:
sed -i 's?library_dirs = [?library_dirs = ['$PATH_TO_FTDI', ?g' ./setup.py
What I want is to replace the text "library_dirs = [" in setup.py with "library_dirs = ['$PATH_TO_FTDI', " where the single quotes, comma, and space need to exist and $PATH_TO_FTDI will be replaced with what is stored in that environment variable.
I know the solution requires escaping, and I get that when it comes to, say, directory names with spaces in them (e.g. My\ Whacky\ Folder), but I'm not sure how to do it here.