[Toybox] Slow grep

Rob Landley rob at landley.net
Fri Sep 16 12:00:22 PDT 2022


On 9/16/22 09:47, Yi-yo Chiang wrote:
> (Tangent. Seems like xxd behavior is different everywhere, I should be careful
> and also note my expected output next time I use xxd as a random string generator.)

It's good to get it right, I just dunno what "right" is here. :)

> On my debian machine (with the same 2022-01-14 build as Elliott), `man xxd` says...
> * -p: Plain text output, '-g' is ignored, '-c' defaults to 30, '-c 0' results in
> one long line (yes '-p -c 0' is a special case for "plain text no wraping no
> grouping")

Special case. Got it.

Plus I wasn't allowing -g 0 to suppress grouping, which is in the man page I've
got here...

> * doesn't say what would happen with '-c 0' otherwise

Here xxd -c 0 seems to be allowed but ignored. Then again my devuan brontasaurus
install with a /bin/ls from 2019 has an xxd --version claiming October 27, 1998.
Seems to be one of those tools like netcat that worked well enough as-is to get
fossiled...

Lemme take a stab at it. (Supporting TT.g = 0 is gonna take a little surgery to
avoid division by zero errors...)

Rob


More information about the Toybox mailing list