parallel
[Top][All Lists]
Advanced

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

Re: --nest for nested argument files


From: Ole Tange
Subject: Re: --nest for nested argument files
Date: Wed, 4 May 2011 16:27:48 +0200

On Wed, May 4, 2011 at 4:21 PM, Ole Tange <tange@gnu.org> wrote:
> On Tue, May 3, 2011 at 6:08 PM, Ole Tange <tange@gnu.org> wrote:
>> On Tue, May 3, 2011 at 4:25 PM, Hans Schou <chlor@schou.dk> wrote:
>>> 2011/5/3 Ole Tange <tange@gnu.org>:
>>
>>>> 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:

One of the files could be - == stdin

Hans' example with wav files could then be written as:

parallel oggenc -q {1} {2} {2.}_{1}.ogg ::: 1 5 10 :::: wavfiles

or

parallel oggenc -q {1} {2} {2.}_{1}.ogg ::: 1 5 10 ::: *.wav

or

ls *.wav | parallel oggenc -q {1} {2} {2.}_{1}.ogg ::: 1 5 10 :::: -

> 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?

Is this syntax too weird? Would it make sense anyway?

/Ole



reply via email to

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