perl or bash question ["convert strings in a txt to html links"]

Vadkan Jozsef jozsi.avadkan at
Sat Feb 27 17:12:05 UTC 2010

How can I do that in bash or perl, that I have a txt file, e.g.:

$cat file.txt
Hi, this is the content of the txt file, that contains links like this:, and it could contain:,
This is the second line, that doesn't contains links..
This is the XYZ line, that contains a link:

...ok.. so how could I make a regexp for this?


to this:

<a href=></a>
<a href=></a>

The solution would be:

sed 'SOMEMAGIC' file.txt > file.html
perl 'SOMEBIGMAGIC' file.txt > file.html


More information about the ubuntu-users mailing list