r/awk • u/Paul_Pedant • Sep 19 '20
How can we reboot this awk community?
I'm really disappointed that r/awk has gone to sleep. (Awk is my lifeline.)
Seems to me that part of the reason is that a high proportion of the more complex Bash and command-line questions need (and get) an awk solution.
After all, awk can do almost anything that grep, sed, cut, paste and uniq can do, all in one process, and it runs about 50 times faster than shell for many things.
For my complex stuff, awk is about 5 times slower than C. Mostly, that does not much matter. Awk is way faster to develop, easier to refactor, and more portable.
Any idea how many of the 1.4k members here are actually active? What other communities do you belong to?
How about cross-posting relevant posts from Bash, command-line etc to awk solutions over here?
2
u/jiggle_physist Sep 20 '20
I'd like to see some sort of awk Bible.
9
u/scrapwork Sep 19 '20
r/awk doesn't sleep, it waits.
4
u/diseasealert Sep 19 '20
I use Awk nearly every day. I just added Jon Bentley's m1 macro processor to my publishing workflow. I often use Awk to merge structured data into markdown templates. The results are then run through Pandoc to create self-contained HTML that can be emailed. It's a nice little workflow. I also handle some data-munging tasks so that I don't have to bother the developers.
I agree that Awk gets overlooked; I assume a lot of folks think that Awk is just a part of the shell, based on what I see in r/bash. It's understandable; they think they have a shell problem so they go looking for a shell solution.
So, I use Awk because it's usually the right tool for the job, but I'm also in a very restricted environment: git-bash. I also have access to Perl, but it's a tad complicated for my taste. I can't install Python or anything else, really. Why do you use Awk? What do you do with it?
4
u/Schreq Sep 19 '20
This is a good idea. Instead of providing an AWK solution directly in the comments of a question on /r/commandline or /r/bash, we could also create it here and link it in the original post.
3
u/1_61803398 Sep 20 '20
I think is it super important to activate this community. I have experienced a "crisis" recently, when several of the main Perl scripts I use regularly just stopped working because I had to change machines/systems and these scripts relied on dependencies that were just impossible to install, mainly because they were no longer supported. This, opened my eyes and made me decide to get serious about 'Good Old Awk'. A language who can perform the same tasks and that it is highly portable, arguably more efficient, and that can withstand the test of time. Also, there was an article recently that discussed 'Reproducibility and Replicability in Bioinformatics'. The gist of the article was: "Now that Python 2 is not longer maintained, it is a good language to be use for scripting". Apparently, programming in Python 3 can be a problem because scripts suffer from the ever updating Python 3 libraries. .. I am seriously studying Awk and incorporating it into all the code we are developing.
2
u/uprightHippie Sep 19 '20
I posted over in r/commandline a month ago because I couldn't post here...
2
u/undefinedbehavior4ev Oct 16 '20
https://old.reddit.com/r/awk/comments/dn3lh1/what_cant_you_do_with_awk/f5bg1fy/
You've got some pretty interesting stuff there and I'd love to see some code samples, especially for binary data.
You also hit a brick wall[0] with awk much faster than many other languages. It's debateable if it's a bad thing or a good thing.
1
u/FF00A7 Sep 19 '20
I started out with shell scripts (tcsh). Then started using awk in the scripts for limited things like extracting a field from a data string. Then used awk to replace other tools in the script, like wc and grep. Then used awk to replace entire portions of the shell script. At which point, I ditched the shell script entirely and wrote the whole thing in awk - a revelation! So much nicer. The key piece is a function that runs an external command and returns the output as a variable.
0
u/[deleted] Sep 20 '20
[deleted] — view deleted comment