[Top][All Lists]

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

Re: Input pattern

From: Ali Roustaei
Subject: Re: Input pattern
Date: Wed, 23 Mar 2016 10:07:55 -0700

Thanks Ole. So right now it is not a built in feature. And thanks for the workaround solution, it does its job for me right now.

On Tue, Mar 22, 2016 at 1:47 AM, Ole Tange <> wrote:
On Mon, Mar 21, 2016 at 4:37 PM, Ali Roustaei <> wrote:
> Hello,
> My script (say myscript) has three input parameters H, Re and Bn. Re and Bn
> are tied so that for each Re input there is only a specific Bn.
> I want parallel to run all combinations of H with Bn,Re and not generate
> combinations between Re and Bn. In terms of gnu parallel I want -xapply for
> Re, Bn and usual combination for H with them.
> For example the below shows what I would like parallel to run. Imagine the
> inputs:
> H inputs: A B
> Re inputs: C D E
> Bn inputs: F G H
> (So  C corresponds to F, D to G and E to H)
> myscript A C F
> myscript A D G
> myscript A E H
> myscript B C F
> myscript B D G
> myscript B E H

Currently this is not possible using a single command, but I have had
this problem, too, so I would welcome a patch that made it possible.

My suggestion for syntax would be to introduce a modifier on the
argument separator. Something like +:

  parallel myscript ::: A B ::: C D E :::+ F G H

And if the input source is a file:

  parallel myscript ::: A B ::: C D E ::::+ fgh-file

The idea being that :::+ links the following input source to the
previous --xapply style.

Normal --xapply would then be possible to do like this:

  parallel myscript ::: C D E :::+ F G H

For your current situation this may work:

  parallel --xapply -I ,, --arg-sep ,,, parallel eval echo myscript {}
,, ::: A B ,,, C D E ,,, F G H


reply via email to

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