2010-05-27 06:09:28 +00:00
|
|
|
|
### Test {.} and {}
|
2010-05-27 22:34:00 +00:00
|
|
|
|
### Test {.} with files that have no . but dir does
|
|
|
|
|
/tmp/test-of-{.}-parallel/subdir/file
|
|
|
|
|
/tmp/test-of-{.}-parallel/subdir/file{.}
|
2010-04-13 21:44:02 +00:00
|
|
|
|
ls 1-col.diff|wc;echo 1-col.diff
|
|
|
|
|
1 1 11
|
|
|
|
|
1-col.diff
|
|
|
|
|
ls 1-col.txt|wc;echo 1-col.txt
|
|
|
|
|
1 1 10
|
|
|
|
|
1-col.txt
|
|
|
|
|
ls 2-col.diff|wc;echo 2-col.diff
|
|
|
|
|
1 1 11
|
|
|
|
|
2-col.diff
|
|
|
|
|
ls 2-col.txt|wc;echo 2-col.txt
|
|
|
|
|
1 1 10
|
|
|
|
|
2-col.txt
|
|
|
|
|
ls a|wc;echo a
|
2010-05-27 06:09:28 +00:00
|
|
|
|
6 6 41
|
2010-04-13 21:44:02 +00:00
|
|
|
|
a
|
|
|
|
|
ls b|wc;echo b
|
2010-05-27 06:09:28 +00:00
|
|
|
|
4 4 26
|
2010-04-13 21:44:02 +00:00
|
|
|
|
b
|
2012-10-17 00:09:03 +00:00
|
|
|
|
ls \<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\ \(Zh\<5C>\<5C>nggu\<5C>\<5C>\)|wc;echo \<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\ \(Zh\<5C>\<5C>nggu\<5C>\<5C>\)
|
2010-04-13 21:44:02 +00:00
|
|
|
|
4 12 118
|
|
|
|
|
中国 (Zhōngguó)
|
|
|
|
|
1 1-col.diff
|
|
|
|
|
1 1-col.txt
|
|
|
|
|
1 2-col.diff
|
|
|
|
|
1 2-col.txt
|
2010-05-27 06:09:28 +00:00
|
|
|
|
6 a
|
|
|
|
|
4 b
|
2010-04-13 21:44:02 +00:00
|
|
|
|
4 中国 (Zhōngguó)
|
|
|
|
|
1 1-col.diff
|
|
|
|
|
1 1-col.txt
|
|
|
|
|
1 2-col.diff
|
|
|
|
|
1 2-col.txt
|
2010-05-27 06:09:28 +00:00
|
|
|
|
6 a
|
|
|
|
|
4 b
|
2010-04-13 21:44:02 +00:00
|
|
|
|
4 中国 (Zhōngguó)
|
|
|
|
|
touch -- 1-col/abc-1-col-1-col
|
|
|
|
|
touch -- 1-col/abc-1-col-1-col.diff
|
|
|
|
|
touch -- 1-col/abc-1-col-1-col.txt
|
|
|
|
|
touch -- 2-col/abc-2-col-2-col
|
|
|
|
|
touch -- 2-col/abc-2-col-2-col.diff
|
|
|
|
|
touch -- 2-col/abc-2-col-2-col.txt
|
|
|
|
|
touch -- a/abc-a-a
|
|
|
|
|
touch -- b/abc-b-b
|
2012-10-17 00:09:03 +00:00
|
|
|
|
touch -- \<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\ \(Zh\<5C>\<5C>nggu\<5C>\<5C>\)/abc-\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\ \(Zh\<5C>\<5C>nggu\<5C>\<5C>\)-\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\ \(Zh\<5C>\<5C>nggu\<5C>\<5C>\)
|
2010-04-13 21:44:02 +00:00
|
|
|
|
rm -- 1-col/abc-1-col-1-col
|
|
|
|
|
rm -- 1-col/abc-1-col-1-col.diff
|
|
|
|
|
rm -- 1-col/abc-1-col-1-col.txt
|
|
|
|
|
rm -- 2-col/abc-2-col-2-col
|
|
|
|
|
rm -- 2-col/abc-2-col-2-col.diff
|
|
|
|
|
rm -- 2-col/abc-2-col-2-col.txt
|
|
|
|
|
rm -- a/abc-a-a
|
|
|
|
|
rm -- b/abc-b-b
|
2012-10-17 00:09:03 +00:00
|
|
|
|
rm -- \<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\ \(Zh\<5C>\<5C>nggu\<5C>\<5C>\)/abc-\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\ \(Zh\<5C>\<5C>nggu\<5C>\<5C>\)-\<5C>\<5C>\<5C>\<5C>\<5C>\<5C>\ \(Zh\<5C>\<5C>nggu\<5C>\<5C>\)
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test compress'
|
2014-02-16 15:34:47 +00:00
|
|
|
|
### Test compress
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 5 | parallel -j2 --tag --compress 'seq {} | pv -q -L 10'
|
2014-02-16 15:34:47 +00:00
|
|
|
|
1 1
|
|
|
|
|
2 1
|
|
|
|
|
2 2
|
|
|
|
|
3 1
|
|
|
|
|
3 2
|
|
|
|
|
3 3
|
|
|
|
|
4 1
|
|
|
|
|
4 2
|
|
|
|
|
4 3
|
|
|
|
|
4 4
|
|
|
|
|
5 1
|
|
|
|
|
5 2
|
|
|
|
|
5 3
|
|
|
|
|
5 4
|
|
|
|
|
5 5
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test compress - stderr'
|
2014-02-16 15:34:47 +00:00
|
|
|
|
### Test compress - stderr
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 5 | parallel -j2 --tag --compress 'seq {} | pv -q -L 10 >&2' 2>&1 >/dev/null
|
2014-02-16 15:34:47 +00:00
|
|
|
|
1 1
|
|
|
|
|
2 1
|
|
|
|
|
2 2
|
|
|
|
|
3 1
|
|
|
|
|
3 2
|
|
|
|
|
3 3
|
|
|
|
|
4 1
|
|
|
|
|
4 2
|
|
|
|
|
4 3
|
|
|
|
|
4 4
|
|
|
|
|
5 1
|
|
|
|
|
5 2
|
|
|
|
|
5 3
|
|
|
|
|
5 4
|
|
|
|
|
5 5
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test weird regexp chars'
|
2014-02-16 15:34:47 +00:00
|
|
|
|
### Test weird regexp chars
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 6 | parallel -j1 -I :: -X echo a::b::^c::[.}c
|
2014-02-16 15:34:47 +00:00
|
|
|
|
a1b1^c1[.}c a2b2^c2[.}c a3b3^c3[.}c a4b4^c4[.}c a5b5^c5[.}c a6b6^c6[.}c
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test -m'
|
2010-05-27 06:09:28 +00:00
|
|
|
|
### Test -m
|
2014-07-15 00:40:38 +00:00
|
|
|
|
(echo foo;echo bar;echo joe.gif) | parallel -j1 -km echo 1{}2{.}3 A{.}B{.}C
|
2010-04-13 21:44:02 +00:00
|
|
|
|
1foo bar joe.gif2foo bar joe3 Afoo bar joeBfoo bar joeC
|
2014-07-15 00:40:38 +00:00
|
|
|
|
(echo foo;echo bar;echo joe.gif) | parallel -j1 -kX echo 1{}2{.}3 A{.}B{.}C
|
2010-04-13 21:44:02 +00:00
|
|
|
|
1foo2foo3 1bar2bar3 1joe.gif2joe3 AfooBfooC AbarBbarC AjoeBjoeC
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 6 | parallel -k printf '{}.gif\\n' | parallel -j1 -km echo a{}b{.}c{.}
|
2010-06-16 03:03:52 +00:00
|
|
|
|
a1.gif 2.gif 3.gif 4.gif 5.gif 6.gifb1 2 3 4 5 6c1 2 3 4 5 6
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 6 | parallel -k printf '{}.gif\\n' | parallel -j1 -kX echo a{}b{.}c{.}
|
2010-06-16 03:03:52 +00:00
|
|
|
|
a1.gifb1c1 a2.gifb2c2 a3.gifb3c3 a4.gifb4c4 a5.gifb5c5 a6.gifb6c6
|
2015-07-22 06:28:05 +00:00
|
|
|
|
echo '### Test -m with 60000 args'; seq 1 60000 | perl -pe 's/$/.gif/' | parallel -j1 -km echo a{}b{.}c{.} | tee >(wc; sleep 1) >(md5sum; sleep 1) >/dev/null; wait; sleep 1
|
2010-05-27 06:09:28 +00:00
|
|
|
|
### Test -m with 60000 args
|
2015-06-21 08:39:48 +00:00
|
|
|
|
0891d955e7e2659ee6a88a96f3309b5c -
|
|
|
|
|
20 179960 1286702
|
2015-07-22 06:28:05 +00:00
|
|
|
|
echo '### Test -X with 60000 args'; seq 1 60000 | perl -pe 's/$/.gif/' | parallel -j1 -kX echo a{}b{.}c{.} | tee >(wc; sleep 1) >(md5sum; sleep 1) >/dev/null; wait; sleep 1
|
2010-05-27 06:09:28 +00:00
|
|
|
|
### Test -X with 60000 args
|
2015-06-21 08:39:48 +00:00
|
|
|
|
af6c8c69409b5cbc55aeb95174e23c37 -
|
|
|
|
|
21 60000 1346682
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test -X with 60000 args and 5 expansions'
|
2010-05-27 06:09:28 +00:00
|
|
|
|
### Test -X with 60000 args and 5 expansions
|
2015-05-25 00:27:30 +00:00
|
|
|
|
seq 1 60000 | perl -pe 's/$/.gif/' | parallel -j1 -kX echo a{}b{.}c{.}{.}{} | wc -l
|
2015-06-21 08:39:48 +00:00
|
|
|
|
34
|
2015-05-25 00:27:30 +00:00
|
|
|
|
seq 1 60000 | perl -pe 's/$/.gif/' | parallel -j1 -kX echo a{}b{.}c{.}{.} | wc -l
|
2015-06-21 08:39:48 +00:00
|
|
|
|
25
|
2015-05-25 00:27:30 +00:00
|
|
|
|
seq 1 60000 | perl -pe 's/$/.gif/' | parallel -j1 -kX echo a{}b{.}c{.} | wc -l
|
2015-06-21 08:39:48 +00:00
|
|
|
|
21
|
2015-05-25 00:27:30 +00:00
|
|
|
|
seq 1 60000 | perl -pe 's/$/.gif/' | parallel -j1 -kX echo a{}b{.}c | wc -l
|
2015-06-21 08:39:48 +00:00
|
|
|
|
17
|
2015-05-25 00:27:30 +00:00
|
|
|
|
seq 1 60000 | perl -pe 's/$/.gif/' | parallel -j1 -kX echo a{}b | wc -l
|
2015-06-21 08:39:48 +00:00
|
|
|
|
11
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test {.} does not repeat more than {}'
|
2010-07-09 12:10:22 +00:00
|
|
|
|
### Test {.} does not repeat more than {}
|
2015-05-25 00:27:30 +00:00
|
|
|
|
seq 1 15 | perl -pe 's/$/.gif/' | parallel -j1 -s 80 -kX echo a{}b{.}c{.}
|
|
|
|
|
a1.gifb1c1 a2.gifb2c2 a3.gifb3c3 a4.gifb4c4 a5.gifb5c5 a6.gifb6c6
|
|
|
|
|
a7.gifb7c7 a8.gifb8c8 a9.gifb9c9 a10.gifb10c10 a11.gifb11c11 a12.gifb12c12
|
|
|
|
|
a13.gifb13c13 a14.gifb14c14 a15.gifb15c15
|
|
|
|
|
seq 1 15 | perl -pe 's/$/.gif/' | parallel -j1 -s 80 -km echo a{}b{.}c{.}
|
|
|
|
|
a1.gif 2.gif 3.gif 4.gif 5.gif 6.gif 7.gifb1 2 3 4 5 6 7c1 2 3 4 5 6 7
|
|
|
|
|
a8.gif 9.gif 10.gif 11.gif 12.gif 13.gifb8 9 10 11 12 13c8 9 10 11 12 13
|
|
|
|
|
a14.gif 15.gifb14 15c14 15
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 15 | perl -pe 's/$/.gif/' | parallel -j1 -s 80 -kX echo a{}b{.}c{.}
|
2010-07-09 12:10:22 +00:00
|
|
|
|
a1.gifb1c1 a2.gifb2c2 a3.gifb3c3 a4.gifb4c4 a5.gifb5c5 a6.gifb6c6
|
|
|
|
|
a7.gifb7c7 a8.gifb8c8 a9.gifb9c9 a10.gifb10c10 a11.gifb11c11 a12.gifb12c12
|
|
|
|
|
a13.gifb13c13 a14.gifb14c14 a15.gifb15c15
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 15 | perl -pe 's/$/.gif/' | parallel -j1 -s 80 -km echo a{}b{.}c{.}
|
2010-07-09 20:37:45 +00:00
|
|
|
|
a1.gif 2.gif 3.gif 4.gif 5.gif 6.gif 7.gifb1 2 3 4 5 6 7c1 2 3 4 5 6 7
|
|
|
|
|
a8.gif 9.gif 10.gif 11.gif 12.gif 13.gifb8 9 10 11 12 13c8 9 10 11 12 13
|
2010-07-09 12:10:22 +00:00
|
|
|
|
a14.gif 15.gifb14 15c14 15
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test -I with shell meta chars'
|
2010-05-27 06:09:28 +00:00
|
|
|
|
### Test -I with shell meta chars
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 60000 | parallel -j1 -I :: -X echo a::b::c:: | wc -l
|
2015-06-21 08:39:48 +00:00
|
|
|
|
17
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 60000 | parallel -j1 -I '<>' -X echo 'a<>b<>c<>' | wc -l
|
2015-06-21 08:39:48 +00:00
|
|
|
|
17
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 60000 | parallel -j1 -I '<' -X echo 'a<b<c<' | wc -l
|
2015-06-21 08:39:48 +00:00
|
|
|
|
17
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 60000 | parallel -j1 -I '>' -X echo 'a>b>c>' | wc -l
|
2015-06-21 08:39:48 +00:00
|
|
|
|
17
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test {.}'
|
2010-05-27 06:09:28 +00:00
|
|
|
|
### Test {.}
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo a | parallel -qX echo "'"{.}"' "
|
2010-04-13 21:44:02 +00:00
|
|
|
|
'a'
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo a | parallel -qX echo "'{.}'"
|
2010-04-13 21:44:02 +00:00
|
|
|
|
'a'
|
2014-07-15 00:40:38 +00:00
|
|
|
|
(echo "sleep 3; echo begin"; seq 1 30 | parallel -kq echo "sleep 1; echo {.}"; echo "echo end") | parallel -k -j0
|
2010-04-13 21:44:02 +00:00
|
|
|
|
begin
|
|
|
|
|
1
|
|
|
|
|
2
|
|
|
|
|
3
|
|
|
|
|
4
|
|
|
|
|
5
|
|
|
|
|
6
|
|
|
|
|
7
|
|
|
|
|
8
|
|
|
|
|
9
|
|
|
|
|
10
|
|
|
|
|
11
|
|
|
|
|
12
|
|
|
|
|
13
|
|
|
|
|
14
|
|
|
|
|
15
|
|
|
|
|
16
|
|
|
|
|
17
|
|
|
|
|
18
|
|
|
|
|
19
|
|
|
|
|
20
|
|
|
|
|
21
|
|
|
|
|
22
|
|
|
|
|
23
|
|
|
|
|
24
|
|
|
|
|
25
|
|
|
|
|
26
|
|
|
|
|
27
|
|
|
|
|
28
|
|
|
|
|
29
|
|
|
|
|
30
|
|
|
|
|
end
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test -I with -X and -m'
|
2010-05-27 06:09:28 +00:00
|
|
|
|
### Test -I with -X and -m
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 10 | parallel -k 'seq 1 {.} | 'parallel' -k -I :: echo {.} ::'
|
2010-04-13 21:44:02 +00:00
|
|
|
|
1 1
|
|
|
|
|
2 1
|
|
|
|
|
2 2
|
|
|
|
|
3 1
|
|
|
|
|
3 2
|
|
|
|
|
3 3
|
|
|
|
|
4 1
|
|
|
|
|
4 2
|
|
|
|
|
4 3
|
|
|
|
|
4 4
|
|
|
|
|
5 1
|
|
|
|
|
5 2
|
|
|
|
|
5 3
|
|
|
|
|
5 4
|
|
|
|
|
5 5
|
|
|
|
|
6 1
|
|
|
|
|
6 2
|
|
|
|
|
6 3
|
|
|
|
|
6 4
|
|
|
|
|
6 5
|
|
|
|
|
6 6
|
|
|
|
|
7 1
|
|
|
|
|
7 2
|
|
|
|
|
7 3
|
|
|
|
|
7 4
|
|
|
|
|
7 5
|
|
|
|
|
7 6
|
|
|
|
|
7 7
|
|
|
|
|
8 1
|
|
|
|
|
8 2
|
|
|
|
|
8 3
|
|
|
|
|
8 4
|
|
|
|
|
8 5
|
|
|
|
|
8 6
|
|
|
|
|
8 7
|
|
|
|
|
8 8
|
|
|
|
|
9 1
|
|
|
|
|
9 2
|
|
|
|
|
9 3
|
|
|
|
|
9 4
|
|
|
|
|
9 5
|
|
|
|
|
9 6
|
|
|
|
|
9 7
|
|
|
|
|
9 8
|
|
|
|
|
9 9
|
|
|
|
|
10 1
|
|
|
|
|
10 2
|
|
|
|
|
10 3
|
|
|
|
|
10 4
|
|
|
|
|
10 5
|
|
|
|
|
10 6
|
|
|
|
|
10 7
|
|
|
|
|
10 8
|
|
|
|
|
10 9
|
|
|
|
|
10 10
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 10 | parallel -k 'seq 1 {.} | 'parallel' -j1 -X -k -I :: echo a{.} b::'
|
2010-04-13 21:44:02 +00:00
|
|
|
|
a1 b1
|
|
|
|
|
a2 b1 b2
|
|
|
|
|
a3 b1 b2 b3
|
|
|
|
|
a4 b1 b2 b3 b4
|
|
|
|
|
a5 b1 b2 b3 b4 b5
|
|
|
|
|
a6 b1 b2 b3 b4 b5 b6
|
|
|
|
|
a7 b1 b2 b3 b4 b5 b6 b7
|
|
|
|
|
a8 b1 b2 b3 b4 b5 b6 b7 b8
|
|
|
|
|
a9 b1 b2 b3 b4 b5 b6 b7 b8 b9
|
|
|
|
|
a10 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10
|
2014-07-15 00:40:38 +00:00
|
|
|
|
seq 1 10 | parallel -k 'seq 1 {.} | 'parallel' -j1 -m -k -I :: echo a{.} b::'
|
2010-04-13 21:44:02 +00:00
|
|
|
|
a1 b1
|
|
|
|
|
a2 b1 2
|
|
|
|
|
a3 b1 2 3
|
|
|
|
|
a4 b1 2 3 4
|
|
|
|
|
a5 b1 2 3 4 5
|
|
|
|
|
a6 b1 2 3 4 5 6
|
|
|
|
|
a7 b1 2 3 4 5 6 7
|
|
|
|
|
a8 b1 2 3 4 5 6 7 8
|
|
|
|
|
a9 b1 2 3 4 5 6 7 8 9
|
|
|
|
|
a10 b1 2 3 4 5 6 7 8 9 10
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test -i'
|
2010-05-27 06:09:28 +00:00
|
|
|
|
### Test -i
|
2014-07-15 00:40:38 +00:00
|
|
|
|
(echo a; echo END; echo b) | parallel -k -i -eEND echo repl{.}ce
|
2010-04-13 21:44:02 +00:00
|
|
|
|
replace
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test --replace'
|
2010-05-27 06:09:28 +00:00
|
|
|
|
### Test --replace
|
2014-07-15 00:40:38 +00:00
|
|
|
|
(echo a; echo END; echo b) | parallel -k --replace -eEND echo repl{.}ce
|
2010-04-13 21:44:02 +00:00
|
|
|
|
replace
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test -t'
|
2010-05-27 06:09:28 +00:00
|
|
|
|
### Test -t
|
2014-07-15 00:40:38 +00:00
|
|
|
|
(echo b; echo c; echo f) | parallel -k -t echo {.}ar 2>&1 >/dev/null
|
2010-04-13 21:44:02 +00:00
|
|
|
|
echo bar
|
|
|
|
|
echo car
|
|
|
|
|
echo far
|
2014-07-15 00:40:38 +00:00
|
|
|
|
echo '### Test --verbose'
|
2010-05-27 06:09:28 +00:00
|
|
|
|
### Test --verbose
|
2014-07-15 00:40:38 +00:00
|
|
|
|
(echo b; echo c; echo f) | parallel -k --verbose echo {.}ar 2>&1 >/dev/null
|
2010-04-13 21:44:02 +00:00
|
|
|
|
echo bar
|
|
|
|
|
echo car
|
|
|
|
|
echo far
|