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?
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
@sjfloat@Perl When you get tired of escaping #shell metacharacters in your #awk and #sed pipelines, when you get tired of inventing new ways to pass structured data between small tools as text streams, #Perl is there.
Of course, you can take that last point too far. See #PowerShell or even #jq, where half the “fun” is marshalling between bespoke data structures.
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.
In theory offering more than just one is "trivial" in the sense that for OS/1337 the idea is to have statical binaries (and maybe the few necessary configs) as "#packages" so it's just a download as an archive (#bzip2 because it's available in #toybox) and just pull that and place them in the system.
OFC absolute hardcore folks will literally do #eMail just with #curl, #cat, #sed & #awk I guess, but ideally offering a convenient alternative like #neomutt is better.
@shawnhcorey@wh0x3r @Perl#Perl’s roots are repeatedly acknowledged in the official documentation available via the perldoc command, man pages on #Unix-ish systems, and the web: