2010-12-02 23:04:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-05-05 22:02:08 +00:00
|
|
|
cat <<'EOF' | parallel -j0 -k
|
2010-12-02 23:04:12 +00:00
|
|
|
echo "### Test --basenamereplace"
|
2012-12-28 20:30:30 +00:00
|
|
|
parallel -j1 -k -X --basenamereplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
parallel -k --basenamereplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
2010-12-02 23:04:12 +00:00
|
|
|
|
2011-07-16 23:46:02 +00:00
|
|
|
echo "### Test --bnr"
|
2012-12-28 20:30:30 +00:00
|
|
|
parallel -j1 -k -X --bnr FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
parallel -k --bnr FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
2011-07-16 23:46:02 +00:00
|
|
|
|
2012-04-24 21:59:29 +00:00
|
|
|
echo "### Test --extensionreplace"
|
2012-12-28 20:30:30 +00:00
|
|
|
parallel -j1 -k -X --extensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
parallel -k --extensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
2012-04-24 21:59:29 +00:00
|
|
|
|
|
|
|
echo "### Test --er"
|
2012-12-28 20:30:30 +00:00
|
|
|
parallel -j1 -k -X --er FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
parallel -k --er FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
2012-04-24 21:59:29 +00:00
|
|
|
|
2010-12-02 23:04:12 +00:00
|
|
|
echo "### Test --basenameextensionreplace"
|
2012-12-28 20:30:30 +00:00
|
|
|
parallel -j1 -k -X --basenameextensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
parallel -k --basenameextensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
2010-12-02 23:04:12 +00:00
|
|
|
|
2011-07-16 23:46:02 +00:00
|
|
|
echo "### Test --bner"
|
2012-12-28 20:30:30 +00:00
|
|
|
parallel -j1 -k -X --bner FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
parallel -k --bner FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
2011-07-16 23:46:02 +00:00
|
|
|
|
2010-12-02 23:04:12 +00:00
|
|
|
echo "### Test {/}"
|
2012-12-28 20:30:30 +00:00
|
|
|
parallel -j1 -k -X echo {/} ::: /a/b.c a/b.c b.c /a/b a/b b
|
2010-12-02 23:04:12 +00:00
|
|
|
|
|
|
|
echo "### Test {/.}"
|
2012-12-28 20:30:30 +00:00
|
|
|
parallel -j1 -k -X echo {/.} ::: /a/b.c a/b.c b.c /a/b a/b b
|
2010-12-02 23:04:12 +00:00
|
|
|
|
|
|
|
echo "### Test {#/.}"
|
2012-12-28 20:30:30 +00:00
|
|
|
parallel -j1 -k -X echo {2/.} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
|
2010-12-02 23:04:12 +00:00
|
|
|
|
|
|
|
echo "### Test {#/}"
|
2012-12-28 20:30:30 +00:00
|
|
|
parallel -j1 -k -X echo {2/} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
|
2010-12-02 23:04:12 +00:00
|
|
|
|
|
|
|
echo "### Test {#.}"
|
2012-12-28 20:30:30 +00:00
|
|
|
parallel -j1 -k -X echo {2.} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
|
2010-12-02 23:04:12 +00:00
|
|
|
|
2012-05-05 22:02:08 +00:00
|
|
|
echo "### bug #34241: --pipe should not spawn unneeded processes"
|
2012-12-28 20:30:30 +00:00
|
|
|
echo | parallel -r -j2 -N1 --pipe md5sum -c && echo OK
|
|
|
|
|
|
|
|
echo '### Test of quoting of > bug'
|
|
|
|
echo '>/dev/null' | parallel echo
|
|
|
|
|
|
|
|
echo '### Test of quoting of > bug if line continuation'
|
|
|
|
(echo '> '; echo '> '; echo '>') | parallel --max-lines 3 echo
|
|
|
|
|
|
|
|
echo '### Test of --trim illegal'
|
|
|
|
stdout parallel --trim fj ::: echo
|
|
|
|
|
|
|
|
echo '### Test of eof string on :::'
|
|
|
|
parallel -k -E ole echo ::: foo ole bar
|
|
|
|
|
|
|
|
echo '### Test of ignore-empty string on :::'
|
|
|
|
parallel -k -r echo ::: foo '' ole bar
|
|
|
|
|
|
|
|
echo '### Test of trailing space continuation'
|
|
|
|
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | xargs -r -L2 echo
|
|
|
|
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | parallel -kr -L2 echo
|
|
|
|
parallel -kr -L2 echo ::: foo '' 'ole ' bar quux
|
|
|
|
|
|
|
|
echo '### Test of trailing space continuation with -E eof'
|
|
|
|
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | xargs -r -L2 -E bar echo
|
|
|
|
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | parallel -kr -L2 -E bar echo
|
|
|
|
parallel -kr -L2 -E bar echo ::: foo '' 'ole ' bar quux
|
|
|
|
|
|
|
|
echo '### Test of --colsep'
|
|
|
|
echo 'a%c%b' | parallel --colsep % echo {1} {3} {2}
|
|
|
|
(echo 'a%c%b'; echo a%c%b%d) | parallel -k --colsep % echo {1} {3} {2} {4}
|
|
|
|
(echo a%c%b; echo d%f%e) | parallel -k --colsep % echo {1} {3} {2}
|
|
|
|
parallel -k --colsep % echo {1} {3} {2} ::: a%c%b d%f%e
|
|
|
|
parallel -k --colsep % echo {1} {3} {2} ::: a%c%b
|
|
|
|
parallel -k --colsep % echo {1} {3} {2} {4} ::: a%c%b a%c%b%d
|
|
|
|
|
|
|
|
echo '### Test of tab as colsep'
|
|
|
|
printf 'def\tabc\njkl\tghi' | parallel -k --colsep '\t' echo {2} {1}
|
|
|
|
parallel -k -a <(printf 'def\tabc\njkl\tghi') --colsep '\t' echo {2} {1}
|
|
|
|
|
|
|
|
echo '### Test of multiple -a plus colsep'
|
|
|
|
parallel --xapply -k -a <(printf 'def\njkl\n') -a <(printf 'abc\tghi\nmno\tpqr') --colsep '\t' echo {2} {1}
|
|
|
|
|
|
|
|
echo '### Test of multiple -a no colsep'
|
|
|
|
parallel --xapply -k -a <(printf 'ghi\npqr\n') -a <(printf 'abc\tdef\njkl\tmno') echo {2} {1}
|
|
|
|
|
|
|
|
echo '### Test of quoting after colsplit'
|
|
|
|
parallel --colsep % echo {2} {1} ::: '>/dev/null%>/tmp/null'
|
|
|
|
|
|
|
|
echo '### Test of --colsep as regexp'
|
|
|
|
(echo 'a%c%%b'; echo a%c%b%d) | parallel -k --colsep %+ echo {1} {3} {2} {4}
|
|
|
|
parallel -k --colsep %+ echo {1} {3} {2} {4} ::: a%c%%b a%c%b%d
|
|
|
|
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k --colsep %+ echo {1} {3} {2} {4}
|
|
|
|
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k --colsep %+ echo '"{1}_{3}_{2}_{4}"'
|
|
|
|
|
|
|
|
echo '### Test of -C'
|
|
|
|
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k -C %+ echo '"{1}_{3}_{2}_{4}"'
|
|
|
|
|
|
|
|
echo '### Test of --trim n'
|
|
|
|
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k --trim n --colsep %+ echo '"{1}_{3}_{2}_{4}"'
|
|
|
|
parallel -k -C %+ echo '"{1}_{3}_{2}_{4}"' ::: 'a% c %%b' 'a%c% b %d'
|
|
|
|
|
|
|
|
echo '### Test of bug: If input is empty string'
|
|
|
|
(echo ; echo abcbdbebf;echo abc) | parallel -k --colsep b -v echo {1}{2}
|
|
|
|
|
|
|
|
echo '### Test bug #34241: --pipe should not spawn unneeded processes'
|
|
|
|
seq 3 | parallel -j30 --pipe --block-size 10 cat\;echo o
|
|
|
|
|
|
|
|
echo '### Test :::: mixed with :::'
|
|
|
|
echo '### Test :::: < ::: :::'
|
|
|
|
parallel -k echo {1} {2} {3} :::: <(seq 6 7) ::: 4 5 ::: 1 2 3
|
|
|
|
|
|
|
|
echo '### Test :::: < < :::: <'
|
|
|
|
parallel -k echo {1} {2} {3} :::: <(seq 6 7) <(seq 4 5) :::: <(seq 1 3)
|
|
|
|
|
|
|
|
echo '### Test -a :::: < :::: <'
|
|
|
|
parallel -k -a <(seq 6 7) echo {1} {2} {3} :::: <(seq 4 5) :::: <(seq 1 3)
|
|
|
|
|
|
|
|
echo '### Test -a -a :::'
|
|
|
|
parallel -k -a <(seq 6 7) -a <(seq 4 5) echo {1} {2} {3} ::: 1 2 3
|
|
|
|
|
|
|
|
echo '### Test -a - -a :::'
|
|
|
|
seq 6 7 | parallel -k -a - -a <(seq 4 5) echo {1} {2} {3} ::: 1 2 3
|
|
|
|
|
|
|
|
echo '### Test :::: < - :::'
|
|
|
|
seq 4 5 | parallel -k echo {1} {2} {3} :::: <(seq 6 7) - ::: 1 2 3
|
|
|
|
|
|
|
|
echo '### Test -E'
|
|
|
|
seq 1 100 | parallel -k -E 5 echo :::: - ::: 2 3 4 5 6 7 8 9 10 :::: <(seq 3 11)
|
|
|
|
|
|
|
|
echo '### Test -E one empty'
|
|
|
|
seq 1 100 | parallel -k -E 3 echo :::: - ::: 2 3 4 5 6 7 8 9 10 :::: <(seq 3 11)
|
|
|
|
|
|
|
|
echo '### Test -E 2 empty'
|
|
|
|
seq 1 100 | parallel -k -E 3 echo :::: - ::: 3 4 5 6 7 8 9 10 :::: <(seq 3 11)
|
|
|
|
|
|
|
|
echo '### Test -E all empty'
|
|
|
|
seq 3 100 | parallel -k -E 3 echo :::: - ::: 3 4 5 6 7 8 9 10 :::: <(seq 3 11)
|
|
|
|
|
|
|
|
echo '### Test {#}'
|
|
|
|
seq 1 10 | parallel -k echo {#}
|
|
|
|
|
|
|
|
echo '### Test --seqreplace and line too long'
|
|
|
|
seq 1 100 | stdout parallel -k --seqreplace I echo $(perl -e 'print "I"x130000') \|wc
|
2012-05-05 22:02:08 +00:00
|
|
|
EOF
|