Assume the new URL is saved in a shell variable: $URL
This one-liner may help you:
sed -i "s@\(^OIDCRedirectURI \).*@\1$URL/newredirect@" file
In your example, the URL
is not with a protocol, e.g. HTTP or https. If you want to "reuse" the protocol prefix from the "old" URL, you can add it to the capture group:
sed -i "s@\(^OIDCRedirectURI http[^/]*//\).*@\1$URL/newredirect@" file
just to show it is working:
kent$ cat /tmp/test/f
something
OIDCRedirectURI http://abc-mt.tc.ac.com/newredirect
something
kent$ URL='this.is.new.url'
kent$ sed -i "s@\(^OIDCRedirectURI http[^/]*//\).*@\1$URL/newredirect@" /tmp/test/f
kent$ cat /tmp/test/f
something
OIDCRedirectURI http://this.is.new.url/newredirect
something
$URL = '...'
is actually a command. Writeurl='...'
instead. I recommend shellcheck.net.'
instead of double quotes"
. Apart from that, your main problem is thesed
command as pointed out by Kent. Fixing the quotes is only the first step.