On 20/01/2021 13:02, Martin Gregorie wrote:
> So, questions for Pancho:
>
> - how did you create your input files?
>
> - Is there any chance that they don't contain any 'newline' characters?
>
> I'm asking because its quite possible that awk would stall, waiting for a
> the next character, if it had read several KB of data without finding a
> newline character or EOF.
>
>
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.
I guess he used the echo because he is habitually tidy :-).
Maybe the answer is that for reliability I should have used perl instead
of awk? Maybe perl is more standard?
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|