@tripleo I would also be remiss not to mention #Perl's included perltrap manual page, which notes both the strict and warnings pragmas and also has nice lists of things for those coming from other #programming languages and tools like #AWK, #C and #CPlusPlus, #JavaScript, #sed, and #shell.
Another interesting AWK feature(?) that is likely little known is that there can be any number of BEGIN and END patterns and they can be anywhere in the AWK program. Their statements are concatenated into one action at run-time.
This makes me wonder, has anybody a) ever seen this used in production code and b) why? #awk#unix#linux
PS 1Gotta admit that the point about the object systems in R is somewhat spot on
PS 2 #php gets a dishonorable mention
PS3 I will continue to find ways to continue using all 4 of the aforementioned languages, as they are all performant and deliver in complementary ways.
v1.0 then:
“Perl is kind of designed to make #awk and #sed semi-obsolete […] The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).” https://github.com/Perl/perl5/releases/tag/perl-1.0
This might sound silly, but I installed virt-manager to make things a little easier when using qemu, then created a new virtual machine with debian 12 on it... then installed qemu on that.
The actual reason for this is to make github account separation a little easier...
If you get virt-manager set up properly, it definitely makes using qemu easier, though. I practically just had to tell it to make a new virtual machine using this iso with this much memory and this big of a hard drive, and it was right at the debian install screen. (Set it up with xfce...).
Main tricky parts were that I had to install libvirt first, make myself a member of the libvirt user group, enable the service, and install dnsmasq. Not great, but could've been worse...
Used debian on the virtual box just for a little variety. I like to keep my hand in on different distributions a bit.
AWK was designed to harmoniously integrate with the Shell and follow the Unix philosophy. Perl and to some degree Ruby offer that as well. The ease with which a single line AWK script can be integrated in a Shell pipeline is what keeps it alive. Python very much does not offer that, Python scripts are standalone programs.
What other languages are out there that can do something as simple as 'print $2' in a Shell pipeline? jq comes to mind. #linux#unix#shell#awk#perl#ruby#python
through all of my sysadmin experience i've been using #sed and avoiding #awk… for some reason. scratch that: for no good reason.
awk is to sed what python is to brainfuck.
the awk programs are a lot more easy to compose and modify, flexible and readable. and there's a brilliant book by the authors — now awailable for a free read from archive.org!
in retrospect, i can't see any tasks that i should have done with sed instead of #bash / awk.
So... I pre-ordered the new second edition of The AWK Programming Language and it arrived today. The packaging demonstrated Amazon's keen awareness of talking a good game and failing to follow through. #Amazon#AWK#Linux#Books
Today's @hrbrmstr drop mentions one my favorite CLI languages: #awk, back in the mid to late 1990s it was my workhorse for processing data from molecular dynamics simulations, protein structures and other crazy stuff like that 🙂
#Tcl (also known as Tool Command Language; pronounced as either "tickle" or as an initialism) is a high-level, general-purpose, interpreted, dynamic programming language.
It was made in 1988 by John Ousterhout and it was inspired mainly by #C, #Lisp, #Shell, #Awk and has served as one of the inspirations of #PowerShell and #Python due to its simplicity and elegance.
This may be my most truly cursed #cli ever for graphing #network performance?
This one has everything, a hand rolled artisanal #iperf3, some #json feature extraction, and a spot of #awk for fixing rounding errors, oh and of course, some red hot #gnuplot on #linux#terminal action.
It's been a while since I browsed "The AWK programming language" by Aho and Kernighan.
I had forgotten that, besides teaching the language, the book presents interesting program examples such as an assembler and virtual machine interpreter, a graph drawing language, and other little languages. Using a little language to Implement little languages is cool and kind of meta.
Stephen Ramsay blogged on how he rediscovered AWK:
"At any rate, I’m sure I’m late to some party (or just continuing my admiration for 1970s computing). But: awk. Is. Amazing. And it’s made me rethink what makes for a good dsl."
I tend to follow the logic of awk better than the one of sed (not being a vi enthusiast), but it is good to see when one might be better than the other:
for like more than 30 years, i have kinda skirted writing serious #ShellScripts, getting good with #awk and #sed , and getting really good with #LaTeX because it usually meant a TON of digging through old documentation and piecing things together. Recently, i just started asking #chatgpt things like:
How do I flip through a directory of a bazillion zip files, uncompress each one, put the contents on my NAS, and then move those zip files somewhere else for safekeeping?