Pancho writes:
> I used:
>
> tail -f testfile | mawk...
>
> I used vi to generate files, with newlines, which I appended into the
> testfile, or just echo "stuff..." appended into the test file.
>
> But Richard's example is perfect to demonstrate the problem:
>
>>> $ (seq 9999 | head -c 4095; sleep 2; echo) | mawk '{print}'
>
> Not only does seq quickly generate a byte stream, but it allows you to
> see exactly what byte you are on. I'm not sure why he used the
> brackets () but I left them in as they don't hurt.
If you take them out it means something different.
> I guess he used the echo because he is habitually tidy :-).
I am l-) in this case I wanted one more byte to make up the 4096-byte
input block.
> Maybe the answer is that for reliability I should have used perl
> instead of awk? Maybe perl is more standard?
Perl only has one implementation (albeit many versions of it) so it’s
more predictable in that sense. I doubt it has mawk’s weird approach to
IO, too.
--
https://www.greenend.org.uk/rjk/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|