I am trying to replace a string which is currently output as
so that it will only output as
I am using SED to replace a URL with the latter domain but I'm unable to get it to work. It works if I set "domain1" to be replaced by "domain2" however I want to be able to replace the whole string.
I'm trying to do this will the following code:
for FILE in `cat/WORKDIR/$inputControlFileName`; do sed -i -e "s~$SEARCHTEXT~$REPLACEWITH~g" $OutputDirectory/$FILE; done;
My search parameter is
http://domain1.com/subdomain/http://domain2.com/subdomain and replace parameter is
Appreciate any guidance.
Update Thanks you all for your help, I ended up getting this to work by only outputting domain1.com/domain.2.com and then escaping the values stored in the variables.