HXCOUNT(1)

๐Ÿ’– HXCOUNT(1) ๐Ÿ’–

okay bestie, welcome to hxcount โ€” she's part of the HTML-XML-utils squad and she's here to count your stuff. literally her whole thing. no cap.


โœจ NAME โœจ

hxcount โ€” count elements and attributes in HTML or XML files ๐Ÿงฎ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

hxcount [ file-or-URL ]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so here's the vibe: hxcount goes through your input, counts up how many elements and attributes of each type show up, and then prints a whole lil report on stdout. that's it. that's the gig. and honestly? iconic. ๐Ÿ‘‘


๐ŸŽ€ OPERANDS ๐ŸŽ€

she supports exactly one (1) operand, and it's this one:

  • file-or-URL โ€” the name or the URL of an HTML or XML file. and if you don't give her one? no worries, she just reads from standard input instead. lowkey flexible of her fr fr ๐Ÿซถ

๐Ÿ’€ EXIT STATUS ๐Ÿ’€

the exit values she returns, bestie:

  1. 0 โ€” successful completion. we love a clean win โœจ
  2. > 0 โ€” an error happened while parsing the HTML or XML file ๐Ÿ˜ญ. but listen โ€” hxcount will try to recover from the error and produce output anyway. she's a fighter. she's giving main character energy.

๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

wanna pull remote files through a proxy? set the environment variables http_proxy and ftp_proxy. like, for example:

http_proxy="http://localhost:8080/"

that's it, that's the whole thing ๐Ÿ’œ


๐Ÿ™ˆ BUGS ๐Ÿ™ˆ

don't trust the output if there were errors in the input. seriously. do NOT. ๐Ÿšจ
  • remote files (the ones you specify with a URL) are currently only supported for HTTP. that's it. that's the list.
  • password-protected files, or files that depend on HTTP "cookies", are not handled at all. not even a little bit. (but you can use tools like curl(1) or wget(1) to grab those files yourself โ€” slay, workaround queen ๐Ÿ’…)

๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

asc2xml(1), hxprune(1), hxnormalize(1), hxnum(1), hxtoc(1), hxunent(1), xml2asc(1), UTF-8 (RFC 2279)

go read those too, they're the rest of the friend group ๐Ÿฆ‹โœจ


k bye, this was version 7.x, dated 10 Jul 2011 โ€” she's been serving since 2011 and she still eats ๐Ÿ’–๐ŸŽ€