Am 11.02.2024 um 19:24 schrieb Ecks Hecker:
> i recently tried to use parallel --pipe, but failed. This is what i saw:
>
>> parallel -V
>> GNU parallel 20231122
>>
>> cat source | parallel --recend $'\0' --pipe --block 800 "wc"
>>       0       1     800
>>       0       2     800
>>       0       1     800
>>       0       1     800
>>       0       1     800
>>       0       1     800
>>       0       1     800
>>       0       1     800
>>       0       1     800
>> ...
>>
>> cat source | parallel --null --pipe --block 800 "wc"
>> parallel: Warning: A record was longer than 800. Increasing to
>> --blocksize 1041.
>> parallel: Warning: A record was longer than 1041. Increasing to
>> --blocksize 1355.
>> parallel: Warning: A record was longer than 1355. Increasing to
>> --blocksize 1763.
>> parallel: Warning: A record was longer than 1763. Increasing to
>> --blocksize 2293.
>> parallel: Warning: A record was longer than 2293. Increasing to
>> --blocksize 2982.
>> parallel: Warning: A record was longer than 2982. Increasing to
>> --blocksize 3878.
>> parallel: Warning: A record was longer than 3878. Increasing to
>> --blocksize 5043.
>> parallel: Warning: A record was longer than 5043. Increasing to
>> --blocksize 6557.
>> parallel: Warning: A record was longer than 6557. Increasing to
>> --blocksize 8526.
>> parallel: Warning: A record was longer than 8526. Increasing to
>> --blocksize 11085.
>> parallel: Warning: A record was longer than 11085. Increasing to
>> --blocksize 14412.
>> parallel: Warning: A record was longer than 14412. Increasing to
>> --blocksize 18737.
>> parallel: Warning: A record was longer than 18737. Increasing to
>> --blocksize 24360.
>> parallel: Warning: A record was longer than 24360. Increasing to
>> --blocksize 31669.
>>       0     283   29040
> This seems to demonstrate, that -0, --null of --recend are not handled
> properly in combination with --pipe.
>
> What can/should i do instead? (the source usually is a command, not a
> file, as in this example)
Just noticed: I forgot to state the unobvious fact:
> cat source | tr "$'\0'" "\n" | wc
>     508     790   19896


Reply via email to