3 ms·
The way to see if something works in AWK is to read the 2004 Open group POSIX standard on it: https://pubs.opengroup.org/onlinepubs/009695399/utilities/awk.htm
by strenholme 7y ago
The way to see if something works in AWK is to read the 2004 Open group POSIX standard on it:
https://pubs.opengroup.org/onlinepubs/009695399/utilities/awk.html https://pubs.opengroup.org/onlinepubs/009695399/utilities/aw...
Here’s my AWK (OK, shell + AWK) one liner:
while echo -n '] ' ; do read a; awk 'BEGIN{print '"$a"'}' ; done
It’s a calculator; type in something like 2 + 2 and it will give you 4. Since standard AWK has advanced math functions like log, it’s a full blown scientific calculator.
The only tricky part is that you hit Ctrl + C (not Ctrl + D) to exit it.