Hello!

I am pleased to announce a new version of my CLI text processing with GNU awk ebook. This book will dive deep into field processing, show examples for filtering features, multiple file processing, how to construct solutions that depend on multiple records, how to compare records and fields between two or more files, how to identify duplicates while maintaining input order and so on. Regular expressions will also be discussed in detail.

Book links

To celebrate the new release, you can download the PDF/EPUB versions for free till 06-April-2025.

Or, you can read it online at https://learnbyexample.github.io/learn_gnuawk/

Interactive TUI apps

Feedback

I would highly appreciate it if you’d let me know how you felt about this book. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn’t!) and so on.

Happy learning :)

  • AnAmericanPotato@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 days ago

    Is it more for situations that need to be compatible with most *nix systems and you might not necessarily have access to a higher level scripting language?

    Yes, and also because integrating Python one-liners into shell pipelines is awkward in general. I’m more likely to write my entire script in Python than to use it just for text processing, and a lot of the time that’s just a pain. Python isn’t really designed for one-liners or for use as a shell. You can twist it into working in those use cases, but then I’d ask the reverse question: why would you do that when you could “just” use awk?

    On macOS, Python is not installed by default. So if you are writing scripts that you want to be portable across platforms, or for general Mac administration, using Python is a burden.

    This is also true when working with some embedded devices. IIRC I can ssh into my router and use awk (thanks to it being included in Busybox), but I’m definitely not going to install an entire Python environment there. I’m not sure there’d even be enough storage space for that.