XMLGAWK(1)

πŸ“¦ version 1.1.2, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

✨ XMLGAWK(1) ✨

Utility Commands πŸŽ€ β€” ok bestie, sit down, this one's short and sweet and it's literally a whole vibe


πŸ’– NAME πŸ’–

xmlgawk β€” it's the gawk XML wrapper script, no cap πŸ¦‹


🌸 SYNOPSIS 🌸

xmlgawk gawk options...

✨ DESCRIPTION ✨

Okay so here's the tea: xmlgawk is a trivial wrapper script. Like, that's not me being shady β€” that's genuinely what it is. It's a lil baby script that does exactly one job and does it slay πŸ’…

What it does: it invokes gawk with the xmllib library, and the way it pulls that off is by inserting the argument -ixmllib before the command-line arguments you supplied. That's it. That's the whole thing. 🫢

So anything you'd hand to gawk normally, xmlgawk sneaks -ixmllib in front of it and then lets gawk do its thing. Iconic behaviour, honestly.


πŸ”₯ SEE ALSO πŸ”₯

  • info xmlgawk πŸ‘‘

(yeah, that's the whole list, go read the info page, iykyk)


πŸŽ€ EXAMPLES πŸŽ€

Okay so say you want to print the CDATA from each "name" element, but only after each one ends. Here's the move:

xmlgawk 'EE == "name" {print CDATA}' sample.xml

What's happening here: after each "name" element ends, this prints the CDATA from that element. And because it's xmlgawk and not plain old gawk, the xmllib library is already loaded for you behind the scenes, so EE and CDATA just work. No extra setup, no stress, we love that for us πŸ’–


🌈 ACKNOWLEDGEMENTS 🌈

The script and the library were originally written by Stefan Tramm. Absolute legend, we stan πŸ‘‘πŸŒΈ


🫢 fr fr that's the entire page β€” tiny, but mighty, and it does exactly what it says on the tin.

Gawkextlib Project πŸ’œ Mon Aug 21 2017 πŸ¦‹ β€” and that's a wrap bestie, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from