News for hackers. Stuff that matters.
Re:Why Learn Awk? (2016) by shpeedy on Tuesday January 21, 2020 @01:10PM (#22109596)
Perl is much faster[0], with much more features, with bunch of ready to use libraries, with package manager (CPAN), and similar syntax to awk.

Why you use awk?

[0]: http://rc3.org/2014/08/28/surprisingly-perl-outperforms-sed-...

Re:Why Learn Awk? (2016) by rhombocombus on Tuesday January 21, 2020 @02:33PM (#22110588)
I use it for a couple reasons: one, it is installed as a base app on almost every single *nix implementation on the planet, so you can count on having it even on ancient or restrictive environments (which I work in frequently); Two, awk is frequently fast enough for most needs, and generally far faster than a number of off the shelf "modern" tools. The first reason is the one that generally leads me to its use, its ubiquity and power make it a compelling tool.
Re:Why Learn Awk? (2016) by macintux on Tuesday January 21, 2020 @06:25PM (#22112885)
Perl was my second programming love, but awk is much shorter and easier to remember for the simple cases where I need it.

Remembering which Perl command-line arguments simulate awk’s line-by-line processing is harder than just remembering awk.

Re:Why Learn Awk? (2016) by mekazu on Tuesday January 21, 2020 @07:36PM (#22113381)
I use Perl similarly to awk if I need to use regex rather than white space delimited fields.

I think if you know Perl really well and can remember the command line arguments - particularly -E, -n, -I and -p - then it’s a good swap in substitute for grep, sed, awk, cut, bash, etc when whatever 5 min task you’re working on gets a tiny bit more complex.

Similarly a decent version perl 5 seems to be installed everywhere by default.

I’m curious to know if anyone would say the same about python or any other programs? I’m not particularly strong in short python scripting.

Re:Why Learn Awk? (2016) by macintux on Tuesday January 21, 2020 @08:08PM (#22113564)
I would say Perl’s native support for regular expressions makes it more useful on the CLI than Python, but Python is also very low on my preferred languages list.

I do, however, use it for JSON pretty printing in a pipeline: python -mjson.tool IIRC.

Re:Why Learn Awk? (2016) by Scarbutt on Tuesday January 21, 2020 @02:12PM (#22110313)
Because you can learn awk in 1/10 of a time it takes to learn perl.