[Toybox] awk seen in the wild

Rob Landley rob at landley.net
Sun Jul 10 09:52:51 PDT 2016


On 07/08/2016 11:36 AM, enh wrote:
> https://github.com/android-ndk/ndk/issues/133#issuecomment-231318129
> is the first time in about a decade i've seen awk more complicated
> than "print $2" in the wild...
> 
>   readelf -sW toolkit/library/libxul.so |grep FUNC |awk '$2 ~ /[048c]$/ {print}'
> 
> ruins my genius plan to "implement" an awk that only supports "print
> $(\d+)"... :-)

A lot of autoconf stuff uses fairly horrible and elaborate awk. Here's a
bug I extracted fro the glibc build many moons ago:

http://lists.busybox.net/pipermail/busybox/2004-February/044743.html

And this was freeswan:

http://lists.busybox.net/pipermail/busybox/2004-July/011979.html

And here was debian's port of the Defective Annoying SHell:

http://lists.busybox.net/pipermail/busybox/2007-January/025743.html

And so on...

It does get used. I have the posix awk spec and a copy of "The AWK
Programming Language" and intend to do a thing with this when I get
time, but it's a bit down the todo list.

I met Steve French at txlf again (I had dinner with him a couple years
ago but couldn't remember his _name_) and he walked me through the Linux
kernel source files that implement the smb3 server in its simplest mode
and I'm pretty sure I can implement a posix-only latest protocol only
tiny smb server in toybox (it needs to implement something like 19
commands, and can reply "no" to all the weird flags asking it to do
non-posix things like case insensitivity).

He thinks it'll take 3000 lines, I'm hoping to keep it under 1000 lines.
So that got added to the todo list this weekend, presumably before awk. :)

Rob



More information about the Toybox mailing list