I am trying to replace in multiple files every instance of text that begins with http and add hyperlink characters to it. I can get it to work with the following:
sed -e "s/http*.*/<a href=\"&\">&<\/a>/g" *
as long as the http text is at the end of the file. I need it to stop at the end of the text which will end with a html, sh or cgi.
Example text file before:
If you wish to view your options, go to http://20.1.1.1/myoptions.cgi or go to http://10.1.1.1/nextoptions.sh
Example of after:
If you wish to view your options, go to <a href="http://20.1.1.1/myoptions.cgi">http://20.1.1.1/myoptions.cgi</a> or go to <a href="http://10.1.1.1/nextoptions.sh">http://10.1.1.1/nextoptions.sh</a>