tripleo, to random
@tripleo@fosstodon.org avatar

All you nutcases still using , what's actually wrong with it?

aka What are the sharp edges?

mjgardner,
@mjgardner@social.sdf.org avatar

@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.

https://perldoc.perl.org/perltrap

mboelen, to linux
@mboelen@mastodon.social avatar

I'm working on a cheat sheet for #AWK. This nifty tool is easily overlooked, but so powerful that it really made me invest more time into learning it.

The initial version of the cheat sheet is available and ready for feedback: https://linux-audit.com/cheat-sheets/awk/

Boosts would be appreciated, and feedback even more!

What are your AWK one-liners that others really need to know and should be included?

Special thanks to @DopeGhoti

#linux #sysadmin #automation #shell

jacobydave, to random

I use sed and awk enough to know I should use them, but not enough to know, necessarily, whether it's sed or awk I need at any specific instance.

mjgardner,
@mjgardner@social.sdf.org avatar

@jacobydave #awk when your data has records (lines) and fields (columns).

#sed when it doesn’t.

Combine to taste.

And when you get tired of smushing everything through text pipes or cross-platform differences forcing portable code down to the least-common denominator of features, do what @cestith said and use #Perl: https://mastodon.social/@cestith/111857559756385921

awb, to linux

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

ChristosArgyrop, to php

I think I am 50% done finding a quadrafecta : a simultaneous hit piece against & .

This one only manages to trash talk and , so it has some ways to go.

https://stefanoborini.com/why-r-is-the-new-perl/

PS 1Gotta admit that the point about the object systems in R is somewhat spot on
PS 2 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.

mjgardner,
@mjgardner@social.sdf.org avatar

@ChristosArgyrop @BobOHara By "happily derivative," Larry meant that #Perl intentionally resembles other languages and tools.

In context, he was responding in 1992 (Perl's current version was 4.035) to @bduncan whinging, “It's sorta like #sed, but not. It's sorta like #awk, but not.” https://groups.google.com/g/comp.unix.shell/c/J8fGo0oGUCk/m/LhF4pSEaOMwJ

mjgardner,
@mjgardner@social.sdf.org avatar

@Edwardsmoon @ChristosArgyrop @BobOHara @bduncan Yes, #Perl deliberately borrows familiar things from #Unix culture, including #C, #shell, #sed, and #awk. The goal isn’t necessarily to replace them, but to remove friction when combining their capabilities.

@randalschwartz's Perl solutions to #Usenet Unix questions usually demonstrated such reductions.

mjgardner,
@mjgardner@social.sdf.org avatar
mjgardner,
@mjgardner@social.sdf.org avatar

@ChristosArgyrop @Edwardsmoon @BobOHara So… fashion and received wisdom traced back to the turn-of-the-century boom in shitty #Perl, supported by the belief that they're protected from building a shitty melange of #shell, #sed, #awk, #Python, and #Rstats?

mjgardner, to programming
@mjgardner@social.sdf.org avatar

@Perl Happy 36th #birthday to the #Perl #programming language!

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

v5.38.2 now:
“Perl is […] now used for a wide range of tasks including #SysAdmin, #WebDev, network programming, #GUI development, and more.” https://perldoc.perl.org/perlintro#What-is-Perl%3F

mjgardner, (edited )
@mjgardner@social.sdf.org avatar

@adrianco @Perl I hope your #awk script only uses the subset supported by a2p: https://metacpan.org/pod/App::a2p

Also, it hasn’t been included with #Perl for eight years. @leont has been looking for a new maintainer for three.

SweetAIBelle, to random

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.

kkarhan,

U mean, peaople say #vim / #vi is hard, but compared to #SCORE it's like #LibreOfficeWriter & #Scribus compared to using #ed / #sed & #awk to write mathematical formulas in #LaTeX by hand on a Teletype...

But then again those that can do the latter really know their shit backwards and upside down so hats off to them...
https://www.youtube.com/watch?v=XGo4PJd1lng&t=195s

awb, to linux

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

tivasyk, to Bash
@tivasyk@mastodon.social avatar

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.

SeaGL, to random
@SeaGL@mastodon.social avatar

Talk announcement for #SeaGL2023
@FLOX_advocate presents: "Advanced jq: awk for JSON".
Details: https://osem.seagl.org/conferences/seagl2023/program/proposals/950
#SeaGL #awk #json

jartigag, to random
@jartigag@mastodon.social avatar

#AWK magic 😇

video/mp4

raineer, to programming

Just let me be the latest to brag about getting my copy of the 2nd edition of The Awk Programming Language

:blob_nerdy:

This book is just wonderful

#awk #programming

https://bookshop.org/p/books/the-awk-programming-language-brian-kernighan/20334738?ean=9780138269722

william_shotts, to Amazon
@william_shotts@mstdn.social avatar

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

View inside the box showing a small thin book resting in the bottom of a vastly over-sized box.

jmcastagnetto, to random
@jmcastagnetto@mastodon.social avatar

Today's @hrbrmstr drop mentions one my favorite CLI languages: , 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 🙂

See: https://mastodon.social/@hrbrmstr/111046565445854504

tcltk, to 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, , , and has served as one of the inspirations of and due to its simplicity and elegance.

(1/🧵)

jcuff, to linux

This may be my most truly cursed ever for graphing performance?

This one has everything, a hand rolled artisanal , some feature extraction, and a spot of for fixing rounding errors, oh and of course, some red hot on action.

Enjoy! hehe. 😆

./src/iperf3 -c testhost -p 22222 -J | jq '.intervals[].sum.bits_per_second' | awk '{$1=sprintf("%2.2f",$1)}1' | gnuplot -p -e "set term dumb ; plot '< cat -' with lines"

/cc @climagic

amoroso, to random
@amoroso@fosstodon.org avatar

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.

https://openlibrary.org/works/OL3509442W/The_AWK_programming_language

#awk

mdhughes, to random

A new version of the AWK book is coming out! In 2023!
https://awk.dev

amoroso, to linux
@amoroso@fosstodon.org avatar

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."

https://stephenramsay.net/posts/unreasonable-awk.html

#awk #unix #linux

juandesant, to random
@juandesant@astrodon.social avatar

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:

https://www.linuxjournal.com/content/text-manipulation-linux-awk-vs-sed

sergio_101, to ChatGPT

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?

and learn from the answer

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • thenastyranch
  • magazineikmin
  • ethstaker
  • InstantRegret
  • tacticalgear
  • rosin
  • love
  • Youngstown
  • slotface
  • ngwrru68w68
  • kavyap
  • cubers
  • DreamBathrooms
  • megavids
  • mdbf
  • modclub
  • GTA5RPClips
  • normalnudes
  • khanakhh
  • everett
  • cisconetworking
  • osvaldo12
  • anitta
  • Leos
  • Durango
  • tester
  • JUstTest
  • All magazines