bug-parallel
[Top][All Lists]
Advanced

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

Re: GNU Parallel Bug Reports Regression with passing zero-length paramet


From: Andreas Bernauer
Subject: Re: GNU Parallel Bug Reports Regression with passing zero-length parameters
Date: Mon, 27 Jul 2015 07:20:56 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

I can confirm that the behavior has changed. I think it changed to the
better, though, as the colsep argument is treated according to the docs.

Adding '+' to the colsep regexp makes your test work with a recent
version of parallel (20150622):

bash
testfunc() { echo "p1=$1 p2=$2 p3=$3"; }
export -f testfunc
echo -e 'A\t\tB\tC\nD E  F' | parallel --colsep '[[:blank:]]+' testfunc
p1=A p2=B p3=C
p1=D p2=E p3=F

The recent version allows to have 'empty' columns: your test data can
now be interpreted as a four-column input ['A', '', 'B', 'C'] and ['D',
'E', '', 'F'], whereas with previous versions, this was impossible.

Cheers,
Andreas

On 26/07/15 21:09, Steven Honeyman wrote:
> I had a script stop working and the cause turned out to be parallel.
> Bisected to git commit 6a6a5e4d01bc "parallel: Specialized
> shell_quote_scalar for each shell."
> 
> If my input has multiple spaces between columns, each after the first
> is passed as a separate parameter. I know that's a terrible attempt at
> an explanation so here's an example which this commit breaks (first is
> before the commit, second is git latest):
> 
> $ testfunc() { echo "p1=$1 p2=$2 p3=$3"; }
> $ export -f testfunc
> $ echo -e 'A\t\tB\tC\nD E  F' | parallel --colsep '[[:blank:]]' testfunc
> p1=A p2=B p3=C
> p1=D p2=E p3=F
> $ echo -e 'A\t\tB\tC\nD E  F' | ./src/parallel --colsep '[[:blank:]]' testfunc
> p1=A p2= p3=B
> p1=D p2=E p3=
> 
> 
> Thanks,
> Steven
> 



reply via email to

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