[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem using nested parallel
From: |
Hans Schou |
Subject: |
Re: problem using nested parallel |
Date: |
Sun, 1 May 2011 20:34:31 +0200 (CEST) |
User-agent: |
Alpine 2.02 (DEB 1266 2009-07-14) |
On Sun, 1 May 2011, Ole Tange wrote:
parallel -k echo {1}/output/{2} :::: filename <(seq 19 22)
That would only output one line from 'filename' and first number from
seq. I think he want to run 19 20 21 and 22 with each line from
filename.
Example
echo a > filename
echo b >> filename
for v1 in $(cat filename); do
for v2 in $(seq 19 22); do
echo $v1 $v2
done
done
Output:
a 19
a 20
a 21
a 22
b 19
b 20
b 21
b 22
An example which could go with the man page could be:
Find all image files and create two thumb nails images of each.
I don't know who to write it one one line so here is 2 lines which
does it:
find . -name '*.JPG' | parallel echo convert {} -geometry 150 {.}_150.JPG
find . -name '*.JPG' | parallel echo convert {} -geometry 400 {.}_400.JPG
(which would make thumb nails of the thumb nails)
/hans
--
Horsebakken 78, DK-2400 København NV