On Tue, May 3, 2011 at 6:08 PM, Ole Tange <[email protected]> wrote:
> On Tue, May 3, 2011 at 4:25 PM, Hans Schou <[email protected]> wrote:
>> 2011/5/3 Ole Tange <[email protected]>:
>
>>> Do you have a better idea for the syntax? Should it be default (and
>>> thus the current behaviour would require you to use --xapply)?
>>
>> I thought --nest was default. I suggest that --keeporder is changed to
>> be the one to use if you want to run line by line.
>
> If no one is using the current xapply-like functionality (I think I
> have used it once) then I will change the default to nesting and make
> the current behaviour available using --xapply.
At the same time I am considering adopting this syntax:
parallel echo {1} {2} {3} ::: a b c ::: 1 2 ::: X Y
This would run:
echo a 1 X
echo a 1 Y
echo a 2 X
echo a 2 Y
echo b 1 X
echo b 1 Y
echo b 2 X
echo b 2 Y
echo c 1 X
echo c 1 Y
echo c 2 X
echo c 2 Y
It could even be extended so that ::: would mark a section of
arguments on the command line, but :::: would mark a section as files
containing arguments:
echo foo > myfile
echo bar >> myfile
parallel echo {1} {2} {3} ::: a b c :::: myfile ::: X Y
echo a foo X
echo a foo Y
echo a bar X
echo a bar Y
echo b foo X
echo b foo Y
echo b bar X
echo b bar Y
echo c foo X
echo c foo Y
echo c bar X
echo c bar Y
The problem with these approaches is that if one of the files is
called ':::' or '::::' then this will no longer work because the :::
or :::: will confuse GNU Parallel:
parallel gzip ::: *
What do you say?
/Ole