I have a file containing URLs with unique parameters, with some URLs having multiple parameters. I am trying to replace all characters after the
= to something else.
Example URL in
sed -r '/^\=/!s/=.*$/=somevalue/g' file-containing-urls.txt
Though this works, it's only replacing the first parameter and nothing else. I would like all characters after an
= to be a specific string. Here is my result:
https://somewebsite.com/somepath/?param=mystring --> Works https://somewebsite.com/new/path/?param1=mystring¶m2=removed --> Only works for param1
The second example, I would like my string to also carry over to
param2, but it looks like
sed is only replacing the first value and ignoring the rest. All other parameters are getting removed from the view. I thought a
/g would fix this, but I'm always getting the same result. Thank you!