XMLGAWK(1)
β¨ 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
- fedora 43: gawk-xml 1.1.2-2.fc43 Β· GPL-1.0-or-later AND GPL-3.0-or-later
- fedora 44: gawk-xml 1.1.2-3.fc44 Β· GPL-1.0-or-later AND GPL-3.0-or-later
- nixos 26.05: gawkextlib-xml-unstable 2022-10-20
- nixpkgs unstable: gawkextlib-xml-unstable 2022-10-20
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms