2021-08-05 00:20:45 maw 2021-08-05 00:33:29 arrays are quite useful 2021-08-05 00:33:34 everything awk does a shell should 2021-08-05 00:33:37 by default 2021-08-05 00:33:43 because its constantly working with files 2021-08-05 00:33:51 bash is just incredibly ugly and inconsistent 2021-08-05 00:36:08 https://www.oilshell.org/blog/2020/01/simplest-explanation.html this shows promise but its still yuck 2021-08-05 00:38:41 nmz: you can use "set --" in POSIX sh though 2021-08-05 00:38:49 to get arrays 2021-08-05 00:39:52 nmz: awk is really nice 2021-08-05 00:40:13 when I read through the AWK book it seemed like Python meets UNIX 2021-08-05 00:40:20 they had a lot of string manipulating stuff 2021-08-05 00:41:17 well text processing is kind of its main thing 2021-08-05 00:41:20 the fact you can reimplement uniq with just 'seen[$0]++' is awesome 2021-08-05 00:42:41 of course for the uninitiated it can look like gibberish 2021-08-05 00:42:50 like this thing I wrote a week ago seq 100|awk '$0=(x=($0%3?z:"fizz")($0%5?z:"buzz"))?x:$0' 2021-08-05 00:44:11 I've written some project euler problems in oawk that are about as fast as cython too 2021-08-05 00:44:19 not bad for a 30 year old language 2021-08-05 00:44:34 40* 2021-08-05 00:45:18 lol initializing x and using it immediately in the same expression I love it 2021-08-05 00:45:38 The brevity comes for free when you have everything implicitly being a variable 2021-08-05 00:46:29 if ?: worked like lua the code would be shorter 2021-08-05 00:48:23 but I don't think short-circuit evaluation existed back then 2021-08-05 02:34:10 ...What? 2021-08-05 02:35:18 ALGOL-68 had short-circuit evaluation available. 2021-08-05 02:35:28 That's the earliest language I know of for certain that had it. 2021-08-05 02:35:35 There may be earlier ones. 2021-08-05 02:48:45 Lisp too, apparently, so yes, short circuit evaluation WAY predates Awk. 2021-08-05 17:36:56 maw 2021-08-05 17:42:55 maw? 2021-08-05 17:44:22 maw. 2021-08-05 19:37:25 WAM! 2021-08-05 19:39:21 Wam? That is intolerable, I say!