This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: http://stackoverflow.com/questions/2489731/convert-urls-into-html-links-using-sed | |
# Convert URLs into HTML links using sed? | |
sed -i.bakup 's|http.[^ \t]*|<a href="&">&</a>|' htmlfile | |
# a primeira dica: a troca do delimitador padrão pela barra vertical | |
# segunda dica, após o http ele pega o resto da linha exceto espaços e tabulações [^ \t] | |
# terceira dica: uma vez que o padrão vai para a memória do sed pode ser referenciada com o & |
Fonte:stak overflow