Lurker News
Hi,

I recently published my ebook on GNU awk one-liners [1]. It starts from the basics of awk syntax and then discusses one-liner examples. There's a chapter on regular expressions as well. The github repo has the details on how to get the PDF version, all the example files and code snippets used in the book, sample chapters as well the markdown source used to generate the PDF.
I made all my ebooks [2] free last month amidst the pandemic fears. These include GNU grep & ripgrep, GNU sed and three books on regular expressions (Python, Ruby, JavaScript).
I'd appreciate your feedback and hope the books are useful. Happy learning :)
[1] https://github.com/learnbyexample/learn_gnuawk
[2] https://learnbyexample.github.io/books/

Comments (48) 14 threads

Show all comments

Showing thread 3 of 14

collyw7 replies#
I want a Perl one. I never saw the need to do AWK because I knew Perl fairly well.

In saying that the youngsters should learn some of these old school tools. Python is a nice language but the regexes are crap acompared to Perl. I always need to look up the documentation. Perls are built in, clean and concise.
(caturing, groups) = string =~ /regex/
I remember that having not touched Perl in a while. I miss it.

7thaccount#
There is a perl oneliners book from nostarch press
mehrdadn1 reply#
Have yet to learn Perl, but I've frequently not seen it preinstalled on systems, and additionally you sometimes need CPAN to be able to run scripts. awk might not be as powerful, but at least you know it's small, self-contained, and likely to be available in some form on most systems. That's part of its value I think... likely a consequence of not trying to do as much.
asicsp#
Someone else already asked for perl one-liners in this thread. I started with command line text processing repo [1] about three years back. That has a chapter on grep/sed/awk/perl/ruby one-liners along with many other tools. I may convert perl one-liners to a book as well later.

Python's default 're' module does indeed lack many features, but there's 'regex' third party module that would be easier to adapt for perl users.
[1] https://github.com/learnbyexample/Command-line-text-processi...

Scarbutt1 reply#
It takes way less time to learn awk than perl.
collyw#
Yes, but I already know Perl. I assume more people know Perl than AWK, but maybe that's a bias from places I worked.
fernly#
There is an available replacement for Python's standard re library, regex[1], which adds a long list of features and enhancements. It is too little known IMO, despite having existed and been continually maintained and enhanced for nearly a decade.

[1] https://pypi.org/project/regex/