I have file A : a nginx config.
Somewhere in this file I have {here}
I want to replace that {here}
by the content of another file B:
location /blah {
proxy_pass "https://blah.com";
}
I have tried with sed and awk (gsub) but I have issues with the return/unescaped character.
I found a solution but only works only with pattern, doesn't work with substitution. In this example it will append fileB after my marker instead of replacing it :
sed -i '/{here}/{r fileB
:a;n;ba}' nginx.conf