URIFIND(1p)
β¨ URIFIND(1p) β¨
ok so bestie, this is urifind β a little Perl script from the User Contributed Perl Documentation corner of the universe, and it's literally just here to do one job and do it cute. π
πΈ NAME πΈ
urifind β find URIs in a document and dump them to STDOUT. that's the whole personality. no cap. π
π SYNOPSIS π
$ urifind file
π¦ DESCRIPTION π¦
so urifind is a simple script. like, simple simple. it finds URIs in one or more files (it's using URI::Find under the hood, bestie, respect the pipeline π) and it outputs them to STDOUT. that's it. that's the entire arc. no plot twist. π«Ά
want all the URIs in file1? say less:
$ urifind file1
want the URIs from multiple files? just list them as arguments, one after another, like a lil lineup:
$ urifind file1 file2 file3
and here's the part where it gets cozy β urifind will read from STDIN if you give it no files at all, or if you specify a filename of -. so you can pipe straight into it:
$ wget http://www.boston.com/ -O - | urifind
when multiple files are listed, urifind prefixes each URI it finds with the file it came from. so you always know who said what. π¬
$ urifind file1 file2
file1: http://www.boston.com/index.html
file2: http://use.perl.org/
you can turn that prefixing ON for a single file too, with the -p ("prefix") switch:
$urifind -p file3
file1: http://fsck.com/rt/
and you can turn it OFF for multiple files with the -n ("no prefix") switch:
$ urifind -n file1 file2
http://www.boston.com/index.html
http://use.perl.org/
ok now. by default, URIs show up in the order they were found β vibes order, discovery order, the order the universe intended. but if you want them sorted ascii-betically, hit the -s ("sort") option. and if you want them reverse sorted, that's the -r ("reverse") flag β and heads up, -r implies -s, it's a package deal bestie. π₯
$ urifind -s file1 file2
http://use.perl.org/
http://www.boston.com/index.html
mailto:webmaster@boston.com
$ urifind -r file1 file2
mailto:webmaster@boston.com
http://www.boston.com/index.html
http://use.perl.org/
and finally, urifind supports limiting the returned URIs by scheme, or by arbitrary pattern β using the -S option (for schemes, duh π
) and the -P option. and the best part? both -S and -P can be specified multiple times. stack 'em, queen.
$ urifind -S mailto file1
mailto:webmaster@boston.com
$ urifind -S mailto -S http file1
mailto:webmaster@boston.com
http://www.boston.com/index.html
-P takes an arbitrary Perl regex. ngl, it might need to be protected from the shell, so quote it like the icon it is:
$ urifind -P 's?html?' file1
http://www.boston.com/index.html
$ urifind -P '\.org\b' -S http file4
http://www.gnu.org/software/wget/wget.html
add a -d and urifind will dump the regexes generated from -S and -P over to STDERR. -D does the same exact thing but exits immediately after. dump and dip. π
$ urifind -P '\.org\b' -S http -D
$scheme = '^(\bhttp\b):'
@pats = ('^(\bhttp\b):', '\.org\b')
and to remove duplicates from the results? that's the -u ("unique") switch. no repeats, only originals. β
π OPTION SUMMARY π
-sβ sort results.-rβ reverse sort results (implies-s).-uβ return unique results only.-nβ don't include filename in output.-pβ include filename in output (0 by default, but 1 if multiple files are included on the command line).-P $reβ print only lines matching regex'$re'(may be specified multiple times).-S $schemeβ only this scheme (may be specified multiple times).-hβ help summary.-vβ display version and exit.-dβ dump compiled regexes for-Sand-PtoSTDERR.-Dβ same as-d, but exit after dumping.
π AUTHOR π
darren chamberlain <darren@cpan.org>
π COPYRIGHT π
(C) 2003 darren chamberlain
this library is free software; you may distribute it and/or modify it under the same terms as Perl itself. π
π SEE ALSO π
URI::Find
ok bestie that's the whole page, mwah. π this lil gem is from perl v5.34.0, dated 2022-06-28, and it's filed under URIFIND(1p). go find some URIs. slay. β¨π¦π
π¦ where this page comes from
- debian bookworm: liburi-find-perl 20160806-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: liburi-find-perl 20160806-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: liburi-find-perl 20160806-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms