[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Vote: Should $PARALLEL_PID {#} count from 0 or 1
From: |
Jay Hacker |
Subject: |
Re: Vote: Should $PARALLEL_PID {#} count from 0 or 1 |
Date: |
Thu, 14 Apr 2011 11:27:27 -0400 |
I vote for 0:
* Arrays in most programming languages start at 0
* Unix tools that produce multiple files start at 0: split, csplit,
ImageMagick, pamsplit...
* Hadoop output files start at 0
* Integer division of N things numbered 0..N-1 by N maps consecutive
items the same group; 1..N does not
* Integer remainder of N things numbered 0..N-1 mod N gives nice,
ordered round-robin groups; 1..N does not
* Most clusters name their machines node000-nodeXXX
* Having to escape $(( {#} - 1 )) in Bash is not pretty
I also vote for something like {N} or {##} to get the total number of
jobs, and a switch a la 'seq -w' to pad {#} with zeros.
On Wed, Apr 13, 2011 at 6:31 PM, Ole Tange <tange@gnu.org> wrote:
> I have implemented {#} as an alias for $PARALLEL_PID in the current
> Git version. See http://savannah.gnu.org/bugs/?33005
>
> It currently counts from 1 just like $PARALLEL_PID.
>
> Dear users: Would you prefer it counts from 0 or from 1? Please elaborate why.
>
>
> /Ole
>
>