I'm trying to find al URLs in a html file and make a link (a href) of it with terminal.
This is what I have now:
awk '/((19|20)\d{2}-.*\.jpg)/ { print "<a href='"$1"'>$1</a>" }' index.html
After running this there are no errors in the terminal, but the file isn't changed at all.
The filenames are formatted like this: 2016-12-14-PHOTO-00000042.jpg
.
Does somebody have a solution?
update Thanks for the responses already! I will give some further info to make the question complete:
Some of the index.html content:
<p>16-12-16 11:45:43: Wouter: 2016-12-16-PHOTO-00000128.jpg
</p>
<p>16-12-16 11:58:49: Jelle: Hello
</p>
<p>16-12-16 19:05:44: Jelle: 2016-12-16-PHOTO-00000133.jpg
</p>
I'm using macOS 10.12.4.
14-12-16
16-12-16
16-12-16
16-12-16
17-12-16
18-12-16
` It's getting theand the date from the beginning of the line so $1 isn't good.. What do I have to write to get `2016-12-14-PHOTO-00000042.jpg` instead of `
18-12-16`?
– Wouter Beugelsdijk May 19 '17 at 18:22