2010-07-14 10:00:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2010-07-18 02:17:49 +00:00
|
|
|
echo '### Test ::::'
|
|
|
|
echo '### Change --arg-file-sep'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply --arg-file-sep :::: -k echo {1} {2} :::: <(seq 1 10) <(seq 5 15)
|
|
|
|
parallel --xapply --arg-file-sep .--- -k echo {1} {2} .--- <(seq 1 10) <(seq 5 15)
|
|
|
|
parallel --xapply --argfilesep :::: -k echo {1} {2} :::: <(seq 1 10) <(seq 5 15)
|
|
|
|
parallel --xapply --argfilesep .--- -k echo {1} {2} .--- <(seq 1 10) <(seq 5 15)
|
2010-07-18 02:17:49 +00:00
|
|
|
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Test xapply --max-replace-args'
|
2011-05-05 15:37:27 +00:00
|
|
|
seq 0 7 | parallel --xapply -k --max-replace-args=3 echo {3} {2} {1}
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Test -N'
|
2011-05-05 15:37:27 +00:00
|
|
|
seq 1 5 | parallel --xapply -kN3 echo {1} {2} {3}
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Test -N with 0'
|
2011-05-05 15:37:27 +00:00
|
|
|
seq 0 7 | parallel --xapply -kN3 echo {1} {2} {3}
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Test :::: on nonexistent'
|
2011-05-05 15:37:27 +00:00
|
|
|
stdout parallel --xapply -k echo {1} {2} {3} :::: nonexistent
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Test :::: two files'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -k echo {1} {2} :::: <(seq 1 10) <(seq 5 15)
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Test -d, ::::'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kd, 'echo a{1} {2}b' :::: <(echo 1,2,3,) <(echo 5,6,7,8)
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Test -d, :::: one file too much'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kd, echo 'a{1}' '{2}b' :::: <(echo 1,2,3,) <(echo 5,6,7,8) <(echo 9,0)
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Bug: did not quote'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply echo {1} {2} :::: <(echo '>') <(echo b)
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Quote test triplet 1'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kv :::: <(echo 'echo a'; echo 'echo b')
|
|
|
|
parallel --xapply -kv -a <(echo 'echo a'; echo 'echo b')
|
|
|
|
(echo 'echo a'; echo 'echo b') | parallel --xapply -kv
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Quote test triplet 2'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kv echo :::: <(echo 'echo a'; echo 'echo b')
|
|
|
|
parallel --xapply -kv -a <(echo 'echo a'; echo 'echo b') echo
|
|
|
|
(echo 'echo a'; echo 'echo b') | parallel --xapply -kv echo
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Quoting if there is a command and 2 arg files'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kv echo :::: <(echo 'echo a') <(echo 'echo b')
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Quoting if there is a command and 2 arg files of uneven length'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kv echo :::: <(echo 'echo a';echo a1) <(echo 'echo b')
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Quoting if there is no command and 2 arg files'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kv :::: <(echo 'echo a') <(echo 'echo b')
|
2010-07-14 10:00:10 +00:00
|
|
|
echo '### Quoting if there is no command and 2 arg files of uneven length'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kv :::: <(echo 'echo a';echo echo a1) <(echo 'echo b')
|
2010-07-14 19:54:33 +00:00
|
|
|
|
|
|
|
echo '### Test multiple -a'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kv -a <(echo a) -a <(echo b) echo {2} {1}
|
|
|
|
parallel --xapply -kv echo {2} {1} :::: <(echo a) <(echo b)
|
2010-07-14 19:54:33 +00:00
|
|
|
echo '### Multiple -a: An unused file'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kv -a <(echo a) -a <(echo b) -a <(echo c) echo {2} {1}
|
|
|
|
parallel --xapply -kv echo {2} {1} :::: <(echo a) <(echo b) <(echo c)
|
2010-07-14 19:54:33 +00:00
|
|
|
echo '### Multiple -a: nonexistent'
|
2011-05-05 15:37:27 +00:00
|
|
|
stdout parallel --xapply -kv echo {2} {1} :::: nonexist nonexist2
|
|
|
|
stdout parallel --xapply -kv -a nonexist -a nonexist2 echo {2} {1}
|
2010-07-14 21:33:38 +00:00
|
|
|
|
|
|
|
echo '### Test {#.}'
|
2011-05-05 15:37:27 +00:00
|
|
|
parallel --xapply -kv -a <(echo a-noext) -a <(echo b-withext.extension) -a <(echo c-ext.gif) echo {3.} {2.} {1.}
|