Hello everybody,

I'm wondering if I'm missing something about -0/--null behavior with --pipe. I don't seem to be able to split stdin on NUL from a command. Here is an example:

$ parallel --version
GNU parallel 20180322

Let's generate two files, once with newline separator and the other one with \0:

$ parallel -k echo ::: A B C > abc-file
$ cat abc-file
A
B
C
$

$ perl -e 'printf "A\0B\0C\0"' > abc0-file
$ cat abc0-file
ABC$

I want to run a (cat) command spreading each record in abc-file on its stdin:

$ cat abc-file | parallel -N1 --pipe cat
A
B
C
$

3 cat commands are generated:

$ cat abc-file | parallel -N1 --dry-run --pipe cat
cat
cat
cat
$

But I can't make it work with abc0-file:

$ cat abc0-file | parallel -N1 -0 --pipe cat
ABC$

Only one command is generated:

$ cat abc0-file | parallel -N1 -0 --pipe --dry-run cat
cat$

If I don't use --pipe, records are correctly splitted using the NUL separator :

$ cat abc0-file | parallel -N1 -0 echo
A
B
C
$

$ cat abc0-file | parallel -N1 -0 --dry-run echo
echo A
echo B
echo C
$

What do you think ?

Thank you for your help,

Jean-Baptiste






Reply via email to