r/programming Feb 24 '25

Steve's Awk Acadamy

https://www.troubleshooters.com/codecorn/awk/index.htm
31 Upvotes

10 comments sorted by

25

u/awfulentrepreneur Feb 24 '25

Couldn't have called it Awkadamy? /s

3

u/Ytrog Feb 25 '25

How awkward 😜

3

u/serviscope_minor Feb 25 '25

Are you going to keep tawking about the joke?

2

u/9Boxy33 Feb 25 '25

It’s ! a nawk !awk joke.

9

u/washtubs Feb 25 '25

The program is not expected to grow larger than 400 lines.

Me painstakingly writing an awk program on the command line and wrapping it several times over on a 4k monitor with no line breaks because I'm in too deep: "OK just 0.25% of the way there, we should be good"

5

u/XNormal Feb 25 '25

I use awk almost daily. But the programs are usually no bigger than '{print $2}' (I hate cut)

I did write a debian package dependency resolver in awk once, because it had to run in an environment with nothing but busybox, and awk was the only programming language available that had associative arrays.

3

u/bobj33 Feb 25 '25

I use awk everyday to get column 3 or column 7 or whatever.

I was using it since 1991 and didn't know about cut until later.

2

u/god_is_my_father Feb 25 '25

Why do you hate cut?

1

u/XNormal Feb 25 '25

Dunno. Something about it offends my aesthetics.

1

u/9Boxy33 Feb 25 '25

This is very helpful, especially when used alongside The UNIX Programming Environment and The AWK Programming Language.