I'm pretty new to using sed's regex so I have some environment variables that I need to be placed into a file if the appropriate 'placeholder' is found.
root@devproc-01:~# printenv
PROC_MODCONF=Include "conf.d/modconf.cfg.lua"
PROC_MODULES="lastlog"; "firewall"; "message_logging";
Here are my two defined environment variables, below are my sed commands, these are part of a Docker Compose entrypoint file.
sed -i s/'{$PROC_MODULES}'/$PROC_MODULES/g /etc/procdev/conf.d/modules.cfg.lua
sed -i s/'{$PROC_MODCONF}'/$PROC_MODCONF/g /etc/procdev/proc.cfg.lua
But when this script executes, I get the error seen in the title:
sed: -e expression #1, char 27: unterminated `s' command
I have double checked that my placeholder variables are indeed present and correct within those two files. This only happens with these two replacements, all of my other replacements work fine. :/ Does something need to be escaped?
Thanks!
As requested, a snippet of one of the config files so that you can see how the placeholder variables are displayed:
umask = "027";
Include "conf.d/modules.cfg.lua"
{$PROC_MODCONF}
Include "conf.d/c2s-s2s.cfg.lua"