Re:Computational survivalist
by Pete_D on Thursday October 10, 2019 @01:21PM
(#21217032)
> unix wizards will tell me a better way of doing this
Great story. I won't claim to be a wizard, but here's mine:
grep -Eo "mailto:[^\"']*" webpage.html | sed 's/^mailto://' | sort -u
The pattern means "mailto: and then everything up to a single or double quote", and the -o flag means "only show the matches". The main benefit of this approach is that it works even if you have multiple email addresses on a line.
Great story. I won't claim to be a wizard, but here's mine:
The pattern means "mailto: and then everything up to a single or double quote", and the -o flag means "only show the matches". The main benefit of this approach is that it works even if you have multiple email addresses on a line.