parallel
[Top][All Lists]
Advanced

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

Multiple complex replacements per command?


From: Jay Hacker
Subject: Multiple complex replacements per command?
Date: Thu, 15 Nov 2012 13:21:25 -0500

I have a command that takes parameters like "'a {} b {}'" (that's one shell word), where I want each {} replaced with the (same, single) item from stdin.  Right now, I can only seem to give one parameter to each job:

$ seq 4 | parallel echo "'a {} b {}'"
a 1 b 1
a 2 b 2
a 3 b 3
a 4 b 4

I'd like to be able to give as many parameters as will fit on a command line, so I can fork less jobs:

$ seq 4 | parallel -??? echo "'a {} b {}'"
a 1 b 1 a 2 b 2 a 3 b 3 a 4 b 4

I looked into -X, -L, -n, -m, --xargs, and variations, but none of them seem to do what I want.  Is there a way to do this with parallel?

reply via email to

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