When trying to process, for example, 128 bytes of a file at a time, this works:
cat input.dat | parallel --pipe --recend '' -k --block-size 128 "<command>" > output.dat
But this
parallel -a input.dat --pipe --recend '' -k --block-size 128 "<command>" > output.dat
throws an error:
parallel: Warning: A NUL character in the input was replaced with \0.
parallel: Warning: NUL cannot be passed through in the argument list.
parallel: Warning: Did you mean to use the --null option?
Why?
The difference comes from how parallel
handles input:
cat input.dat | parallel ...
:
Piping the content (data) direct will treat it as a stream, with --pipe
splitting it into chunks without interpreting NUL characters.
parallel -a input.dat ...
:
The -a
option reads input.dat
as a list of arguments, where NUL characters cause warnings unless --null
is used.
To fix the the issue with -a
, use:
parallel -a input.dat --pipe --recend '' -k --block-size 128 --null "<command>" > output.dat