i want to change all links in html file using sed like this
s/ <a[^>]* href="[^"]*\// <a href="\http:\/\/www.someurl.com\//g
but it's not working.
My links:
<a href="http://www.mylink.com/help/rss.php" target="_top" title="RSS">RSS</a></div>
my script change only mylink.com/help/rss.php to someurl.com/help/rss.php
I need to change to only someurl.com
Take out the space after the first slash, change all the sed slashes to another character such as | for readability and remove all the escaping from the URL slashes.
sed 's|<a[^>]* href="[^"]*/|<a href="http://www.someurl.com/|g'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With