Open Veraellyunjie opened 1 year ago
Sorry for a long response.
I use PROCINFO
variable here:
And the GAWK manual says it's specific to GAWK:
I added that line because I remember that less did not work as expected if it's exited it with the q
key and the whole file has not been buffered yet. You can reproduce it by running git log | catless
. Make sure to run it in a repo that has a rather long history of commits.
I just discovered that my fix has an undesirable side effect: if you run a command that takes a long time to finish (something like seq 10000
), after quitting less, catless will still keep on going.
In the previous message, by "unexpected behavior" I meant they GAWK printer a fatal error message. But perhaps it's better than what we have know? Or maybe it's easier to rewrite catless in C? 😅 This way both problems will be easily fixed.
First of all, I applause to you as
catless
is really missed in standard distributions and you fill the gap.I tried
catless
via OpenBSD'sawk
which I don't know which awk flavor it is - but it definitely is notgawk
- and it seems to work. So I'd like to ask you whether you targetgawk
or whether you target most awk flavors and whether you think it is reasonable and already safe to change the shebang to widely available#!/usr/bin/awk -f