bug-parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: max-lines option does not work.


From: Ole Tange
Subject: Re: max-lines option does not work.
Date: Wed, 23 Jun 2010 19:46:37 +0200

On Wed, Jun 23, 2010 at 2:58 PM, Martin Ward <address@hidden> wrote:
>
> Example:
>
> % range 1 10 | xargs --max-lines=5 echo
> 1 2 3 4 5
> 6 7 8 9 10
>
> But:
>
> % range 1 10 | parallel --max-lines=5 echo
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
>
> -L and -l give the same result.

GNU Parallel defaults to running jobs in parallel. Therefore it will
as default spawn one process per input line. If you want to have the
xargs behaviour (putting multiple inputs on the same line) you can use
-X or -m.

$ range 1 10 | parallel -X --max-lines=5 echo

Maybe the behaviour should be changed, so --max-lines would
automatically activate -X or -m (as --max-line does not make a lot of
sense without at least one of them). Which would in your opinion be
the right one: -X or -m? Should this

$ range 1 10 | parallel --max-lines=5 echo foo{}bar

do this:

foo1bar foo2bar foo3bar foo4bar foo5bar
foo6bar foo7bar foo8bar foo9bar foo10bar

or do this:

foo1 2 3 4 5bar
foo6 7 8 9 10bar

I tend to think -X would be the most useful.


Regards,

Ole Tange



reply via email to

[Prev in Thread] Current Thread [Next in Thread]