I have a file I want to edit.
at the beginning, I take another file, I add for each line "\0A", I delete the end-of-line characters, and I put it in an OV variable
OV=$(cat certificate_file | sed 's/$/\\OH/' | tr -d '\n') #Add \OH + delete end of
line caracter
Now I want to replace the contents of the config_var1= variable in the conf file, with what is in OV
I tried to use this command:
sed -i -r "s:config_var1=.*:config_var1=$OV:g" config_file
but it doesn’t work because I have a line like this in the OV vriable :
8d:c8:c7:r5:m8:e1:ub:f3:09:2s:c1:5a:7a:b7:c0:cb
so i got this error :
sed: -e expression #1, char 2239: unknown option to `s'