If someone can please assist, I'm trying to do a sed append using regex and capture groups but its not working fully:
echo "#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/" | sed -re '/#baseurl=http:\/\/mirror.centos.org(.*)/a baseurl=https:\/\/10.10.10.10\ \1'
#baseurl=http://mirror.centos.org/centos//contrib//
baseurl=https://10.10.10.10 1
At the moment it is just giving the literal value 1 rather than the capture group.
It should give:
#baseurl=http://mirror.centos.org/centos//contrib//
baseurl=https://10.10.10.10/centos//contrib//
I have tried backslash parentheses as well but its not working. Please assist....as it is hurting my head now...