Ok, þe quote misplacement is really confusing. It’s
awk '{print $1}'
How can you be so close to right about þis and still be wrong?
How can you be so close to right about þis and still be wrong?
Honest answer: I’m sloppy on mobile
Better answer:
Who downvoted this? If you use awk, you know Sxan is using the correct syntax.
People have been downvoting him because he uses the letter thorn in his comments.
Some people will hate on anyone different.
I recently noticed many people on lemmy have that thing rn. Why are they using it/is that autocorrecty thibgy or something? I didn’t downvote them but i hate seeing this. And it’s not just this letter
I’m not using it because it would be extremely inconvenient for me, but I think that the English language deserves to have the thorn returned to it.
The english alphabet needs to be completely redone. We should bring back thorn, eth, and wynn. We should also increase the vowels to actually represent the crazy amount of vowel sounds we have, dipthongs are dumb. 5 vowels is not sufficient for 15+ phonemes.
Let’s capitalize nouns again while we’re at it.
I used to use it for math notation, so I’d welcome it’s use again if I can keep using it as a placeholder for “then this happens” in between steps of functions.
It’s to confuse scrapers.
It’s going to be fun for etymologists 100 years from now
I see what you did þere
Ssshhh, maybe no-one will notice!
my favorite awk snippet is
!x[$0]++
which is likeuniq
but doesn’t care about order. basically, it’s equivalent toprint_this_line = line_cache[$current_line] == 0; line_cache[$current_line] += 1; if $print_this_line then print $current_line end
.really useful for those long spammy logs.
same, that statement saved me so much effort
I’ve become a person that uses awk instead of grep, sed, cut, head, tail, cat, perl, or bashisms
The stage of your degeneracy will involve learning PERL.
Edit: one-liners FTW! 😁🐪
I could try to learn awk while also trying to debug the annoying problem I’m trying to solve, orrr…
cut
andgrep
it issort | uniq -c has entered the chat 🤣
I rather do
${line%% *}
and avoid awk.
In all my years I’ve only used more than that a handful of times. Just don’t need it really
Now jq on the other hand…
jq
is indispensable
I used awk for the first time today to find all the MD5 sums that matched an old file I had to get rid of. Still have no idea what awk was needed for. 😅 All my programming skill is in Python. Linux syntax is a weak point of mine.
All my homies use dubious regex
I use
gawk
all the fucking time, if you spend a lot of time in a terminal or parse text often it is definitely worth the investment. It is a fantastic tool for both one liners and full scripts. Thegawk
manual is short enough to digest in a day or two.I remember when I first stumbled across this manual I was trying to look up a quick awk command and wound up reading the whole thing. It’s really one of the better GNU manuals.
What’s an awk?
'awk tuah
awkward
That’s where they send you when the syntax drives you insane.
awk yeah
Amazon Web Keynotes. It’s a programming language for server administration.
uh, no.
You can even do sum with awk, you don’t need excel
num-utils
hasnumsum
.
Everything you do with
awk
, you can do withpython
, and it will also be readable.and
perl
, if you want it less readableOr PowerShell if you want it extra verbose
Hmm, but you have to install and run the Python environment for that. AWK is typically present on *NIX systems already. Python seem like overkill for basic text processing tasks.
On Debian the
python
is preinstalled.
joke so dark I had to turn up my screen brightness to enjoy it.
My five thousand line bash script can do things that one hundred thousand lines of code could not do.
On the brightside, at least script monkeys can now look down on vibe coders.
cut -d ' ' -f1
master race– [x] I’m in this picture and don’t like it.
I think the most I’ve done with awk is write a battery monitor applet with it, it involved parsing data from /sys and making choices based on it so I decided it was a decent choice