Jeff Waugh wrote:
>
> Here's one for the one liner gladiators:
>
> I need to get the first URL found in a file or stdin. Much like urlview (man
> urlview for a regexp), but without all the UI guff. Think procmail...
>
> As usual, least amount of processes spawned, most minimal software used, and
> shortest length wins. ;)
>
Here's a try using lynx's parser:
cat index.html | lynx -stdin -dump | grep "^References" -A 2 | tail -1 | perl -lne
'$_=~/\d+\. (.+)/; print $1;'
It does run perl (I don't know awk) and lynx, which are both pretty heavy but
it does the job.
Regards,
Sonam
> - Jeff
>
> --
> chown -R us:us yourbase
>
> --
> SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
> More Info: http://slug.org.au/lists/listinfo/slug
--
Electronic Commerce
Corporate Express Australia Ltd.
Phone: +61-2-9335-0725 Fax: +61-2-9335-0753
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug