On Wed, 4 May 2011, Ole Tange wrote:

On Wed, May 4, 2011 at 4:21 PM, Ole Tange <[email protected]> wrote:

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

Looks good. So, all these does the same:

ls *.wav > list

parallel echo {1} {2} ::: 1 2 3 :::: list
parallel echo {1} {2} ::: $(seq 3) ::: *.wav
parallel echo {1} {2} :::: <(seq 3) list
parallel -a <(seq 3) echo {1} {2} ::: *.wav
parallel -a <(seq 3) -a list echo {1} {2}
parallel -a <(seq 3) -a <(ls *.wav) echo {1} {2}
ls *.wav | parallel -a <(seq 3) echo {1} {2} :::: -

Is it really necessary to have the last ':::: -' ?
Will this not do?
  ls *.wav | parallel -a <(seq 3) echo {2} {1}

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:

It is not very often I give my files that name.

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

I think it is good.

/hans
--
Horsebakken 78, DK-2400 København NV

Reply via email to