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?
I use my #Linux Jedi light saber (#Vim) to make a #sed script to remove links to the #Mastodon posts I wanna keep. Clock is ticking on everything else. #C42
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.
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.
new to me: sdhttps://github.com/chmln/sd simple, intuitive find-and-replace command-line tool. I love sed (as one must) but it does have its quirks and does so much with operations formatted differently (why is the command char in different places? Substitute is s/.../.../ but delete is /.../d).
I'm a fan of these improved versions of unix tools (exa, fd, dust), usually written in rust or go. The classics are great but glad we're not stuck with them forever. #cli#unix
@phette23 The command char isn’t in different places. sed is basically
<where><command><options>
[s]ubstitute takes search & replace as options. [d]elete-line doesn’t take any. Your s example has no <where> (runs on every line), your d example no <options> (runs on matching lines only).
And yes, you can totally do
/foo/s/bar/baz/
to replace bar with baz on every line that matches foo.
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: