Can't get any of these to work, despite reading and looking at several
examples. Variable substitution has always been a problem for me
because there doesn't seem to be a single hard-and-fast
rule--sometimes the variable is quoted, sometimes it's wrapped in
braces, sometimes the "$" is interpreted by the shell as a string
positional directive ("$", "%"). All of the following fail:
sed -i 's/replace-this/$with_this_variable/'
sed -i 's/replace-this/${with_this_variable}/'
sed -i 's/replace-this/"${with_this_variable}/'
What am I missing?