mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-12-29 08:07:54 +00:00
12 KiB
12 KiB
echo "bug #43654: --bar with command not using {} - only last output line "
bug #43654: --bar with command not using {} - only last output line
COLUMNS=80 stdout parallel --bar true {.} ::: 1 | perl -pe 's/.*\r/\r/'
100% 1:0=0s 1
echo "### Test --basenamereplace"
### Test --basenamereplace
parallel -j1 -k -X --basenamereplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b.c b.c b.c b b b
parallel -k --basenamereplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b.c
b.c
b.c
b
b
b
echo "### Test --bnr"
### Test --bnr
parallel -j1 -k -X --bnr FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b.c b.c b.c b b b
parallel -k --bnr FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b.c
b.c
b.c
b
b
b
echo "### Test --extensionreplace"
### Test --extensionreplace
parallel -j1 -k -X --extensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
/a/b a/b b /a/b a/b b
parallel -k --extensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
/a/b
a/b
b
/a/b
a/b
b
echo "### Test --er"
### Test --er
parallel -j1 -k -X --er FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
/a/b a/b b /a/b a/b b
parallel -k --er FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
/a/b
a/b
b
/a/b
a/b
b
echo "### Test --basenameextensionreplace"
### Test --basenameextensionreplace
parallel -j1 -k -X --basenameextensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b b b b b b
parallel -k --basenameextensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b
b
b
b
b
b
echo "### Test --bner"
### Test --bner
parallel -j1 -k -X --bner FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b b b b b b
parallel -k --bner FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b
b
b
b
b
b
echo "### Test {/}"
### Test {/}
parallel -j1 -k -X echo {/} ::: /a/b.c a/b.c b.c /a/b a/b b
b.c b.c b.c b b b
echo "### Test {/.}"
### Test {/.}
parallel -j1 -k -X echo {/.} ::: /a/b.c a/b.c b.c /a/b a/b b
b b b b b b
echo "### Test {#/.}"
### Test {#/.}
parallel -j1 -k -X echo {2/.} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
number2
echo "### Test {#/}"
### Test {#/}
parallel -j1 -k -X echo {2/} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
number2.c
echo "### Test {#.}"
### Test {#.}
parallel -j1 -k -X echo {2.} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
a/number2
echo "### bug #34241: --pipe should not spawn unneeded processes"
### bug #34241: --pipe should not spawn unneeded processes
echo | parallel -r -j2 -N1 --pipe md5sum -c && echo OK
OK
echo '### Test of quoting of > bug'
### Test of quoting of > bug
echo '>/dev/null' | parallel echo
>/dev/null
echo '### Test of quoting of > bug if line continuation'
### Test of quoting of > bug if line continuation
(echo '> '; echo '> '; echo '>') | parallel --max-lines 3 echo
> > >
echo '### Test of --trim illegal'
### Test of --trim illegal
stdout parallel --trim fj ::: echo
parallel: Error: --trim must be one of: r l rl lr.
echo '### Test of eof string on :::'
### Test of eof string on :::
parallel -k -E ole echo ::: foo ole bar
foo
echo '### Test of ignore-empty string on :::'
### Test of ignore-empty string on :::
parallel -k -r echo ::: foo '' ole bar
foo
ole
bar
echo '### Test of trailing space continuation'
### Test of trailing space continuation
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | xargs -r -L2 echo
foo ole bar
quux
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | parallel -kr -L2 echo
foo ole bar
quux
parallel -kr -L2 echo ::: foo '' 'ole ' bar quux
foo ole bar
quux
echo '### Test of trailing space continuation with -E eof'
### Test of trailing space continuation with -E eof
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | xargs -r -L2 -E bar echo
foo ole
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | parallel -kr -L2 -E bar echo
foo ole
parallel -kr -L2 -E bar echo ::: foo '' 'ole ' bar quux
foo ole
echo '### Test of --colsep'
### Test of --colsep
echo 'a%c%b' | parallel --colsep % echo {1} {3} {2}
a b c
(echo 'a%c%b'; echo a%c%b%d) | parallel -k --colsep % echo {1} {3} {2} {4}
a b c
a b c d
(echo a%c%b; echo d%f%e) | parallel -k --colsep % echo {1} {3} {2}
a b c
d e f
parallel -k --colsep % echo {1} {3} {2} ::: a%c%b d%f%e
a b c
d e f
parallel -k --colsep % echo {1} {3} {2} ::: a%c%b
a b c
parallel -k --colsep % echo {1} {3} {2} {4} ::: a%c%b a%c%b%d
a b c
a b c d
echo '### Test of tab as colsep'
### Test of tab as colsep
printf 'def\tabc\njkl\tghi' | parallel -k --colsep '\t' echo {2} {1}
abc def
ghi jkl
parallel -k -a <(printf 'def\tabc\njkl\tghi') --colsep '\t' echo {2} {1}
abc def
ghi jkl
echo '### Test of multiple -a plus colsep'
### 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}
abc def
mno jkl
echo '### Test of multiple -a no colsep'
### Test of multiple -a no colsep
parallel --xapply -k -a <(printf 'ghi\npqr\n') -a <(printf 'abc\tdef\njkl\tmno') echo {2} {1}
abc def ghi
jkl mno pqr
echo '### Test of quoting after colsplit'
### Test of quoting after colsplit
parallel --colsep % echo {2} {1} ::: '>/dev/null%>/tmp/null'
>/tmp/null >/dev/null
echo '### Test of --colsep as regexp'
### Test of --colsep as regexp
(echo 'a%c%%b'; echo a%c%b%d) | parallel -k --colsep %+ echo {1} {3} {2} {4}
a b c
a b c d
parallel -k --colsep %+ echo {1} {3} {2} {4} ::: a%c%%b a%c%b%d
a b c
a b c d
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k --colsep %+ echo {1} {3} {2} {4}
a b c
a b c d
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k --colsep %+ echo '"{1}_{3}_{2}_{4}"'
a_b_c_
a_b_c_d
echo '### Test of -C'
### Test of -C
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k -C %+ echo '"{1}_{3}_{2}_{4}"'
a_b_c_
a_b_c_d
echo '### Test of --trim n'
### Test of --trim n
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k --trim n --colsep %+ echo '"{1}_{3}_{2}_{4}"'
a_b_\ c\ _
a_\ b\ _c_d
parallel -k -C %+ echo '"{1}_{3}_{2}_{4}"' ::: 'a% c %%b' 'a%c% b %d'
a_b_c_
a_b_c_d
echo '### Test of bug: If input is empty string'
### Test of bug: If input is empty string
(echo ; echo abcbdbebf;echo abc) | parallel -k --colsep b -v echo {1}{2}
echo ''
echo ac
ac
echo ac
ac
echo '### Test bug #34241: --pipe should not spawn unneeded processes'
### Test bug #34241: --pipe should not spawn unneeded processes
seq 3 | parallel -j30 --pipe --block-size 10 cat\;echo o
1
2
3
o
echo '### Test :::: mixed with :::'
### Test :::: mixed with :::
echo '### Test :::: < ::: :::'
### Test :::: < ::: :::
parallel -k echo {1} {2} {3} :::: <(seq 6 7) ::: 4 5 ::: 1 2 3
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test :::: < < :::: <'
### Test :::: < < :::: <
parallel -k echo {1} {2} {3} :::: <(seq 6 7) <(seq 4 5) :::: <(seq 1 3)
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test -a :::: < :::: <'
### Test -a :::: < :::: <
parallel -k -a <(seq 6 7) echo {1} {2} {3} :::: <(seq 4 5) :::: <(seq 1 3)
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test -a -a :::'
### Test -a -a :::
parallel -k -a <(seq 6 7) -a <(seq 4 5) echo {1} {2} {3} ::: 1 2 3
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test -a - -a :::'
### Test -a - -a :::
seq 6 7 | parallel -k -a - -a <(seq 4 5) echo {1} {2} {3} ::: 1 2 3
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test :::: < - :::'
### Test :::: < - :::
seq 4 5 | parallel -k echo {1} {2} {3} :::: <(seq 6 7) - ::: 1 2 3
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test -E'
### Test -E
seq 1 100 | parallel -k -E 5 echo :::: - ::: 2 3 4 5 6 7 8 9 10 :::: <(seq 3 11)
1 2 3
1 2 4
1 3 3
1 3 4
1 4 3
1 4 4
2 2 3
2 2 4
2 3 3
2 3 4
2 4 3
2 4 4
3 2 3
3 2 4
3 3 3
3 3 4
3 4 3
3 4 4
4 2 3
4 2 4
4 3 3
4 3 4
4 4 3
4 4 4
echo '### Test -E one empty'
### Test -E one empty
seq 1 100 | parallel -k -E 3 echo :::: - ::: 2 3 4 5 6 7 8 9 10 :::: <(seq 3 11)
1 2
2 2
echo '### Test -E 2 empty'
### Test -E 2 empty
seq 1 100 | parallel -k -E 3 echo :::: - ::: 3 4 5 6 7 8 9 10 :::: <(seq 3 11)
1
2
echo '### Test -E all empty'
### 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 {#}'
### Test {#}
seq 1 10 | parallel -k echo {#}
1
2
3
4
5
6
7
8
9
10
echo '### Test --seqreplace and line too long'
### Test --seqreplace and line too long
seq 1 1000 | stdout parallel -j1 -s 210 -k --seqreplace I echo IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII \|wc | uniq -c
9 1 1 101
90 1 1 201
1 parallel: Error: Command line too long (309 >= 210) at input 0: 100
echo '### bug #37042: -J foo is taken from the whole command line - not just the part before the command'
### bug #37042: -J foo is taken from the whole command line - not just the part before the command
echo '--tagstring foo' > ~/.parallel/bug_37042_profile; parallel -J bug_37042_profile echo ::: tag_with_foo; parallel --tagstring a -J bug_37042_profile echo ::: tag_with_a; parallel --tagstring a echo -J bug_37042_profile ::: print_-J_bug_37042_profile
foo tag_with_foo
a tag_with_a
a -J bug_37042_profile print_-J_bug_37042_profile
echo '### Bug introduce by fixing bug #37042'
### Bug introduce by fixing bug #37042
parallel --xapply -a <(printf 'abc') --colsep '\t' echo {1}
abc
echo "### Test --header with -N"
### Test --header with -N
(echo h1; echo h2; echo 1a;echo 1b; echo 2a;echo 2b; echo 3a)| parallel -j1 --pipe -N2 -k --header '.*\n.*\n' echo Start\;cat \; echo Stop
Start
h1
h2
1a
1b
Stop
Start
h1
h2
2a
2b
Stop
Start
h1
h2
3a
Stop
echo "### Test --header with --block 1k"
### Test --header with --block 1k
(echo h1; echo h2; perl -e '$a="x"x110;for(1..22){print $_,$a,"\n"'})| parallel -j1 --pipe -k --block 1k --header '.*\n.*\n' echo Start\;cat \; echo Stop
Start
h1
h2
1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
22xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Stop
echo "### Test --header with multiple :::"
### Test --header with multiple :::
parallel --header : echo {a} {b} {1} {2} ::: b b1 ::: a a2
a2 b1 b1 a2
bug #43654: --bar with command not using {} - only last output line
COLUMNS=80 stdout parallel --bar true {.} ::: 1 | perl -pe 's/.*\r/\r/'
100% 1:0=0s 1
echo "### Test --basenamereplace"
### Test --basenamereplace
parallel -j1 -k -X --basenamereplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b.c b.c b.c b b b
parallel -k --basenamereplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b.c
b.c
b.c
b
b
b
echo "### Test --bnr"
### Test --bnr
parallel -j1 -k -X --bnr FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b.c b.c b.c b b b
parallel -k --bnr FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b.c
b.c
b.c
b
b
b
echo "### Test --extensionreplace"
### Test --extensionreplace
parallel -j1 -k -X --extensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
/a/b a/b b /a/b a/b b
parallel -k --extensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
/a/b
a/b
b
/a/b
a/b
b
echo "### Test --er"
### Test --er
parallel -j1 -k -X --er FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
/a/b a/b b /a/b a/b b
parallel -k --er FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
/a/b
a/b
b
/a/b
a/b
b
echo "### Test --basenameextensionreplace"
### Test --basenameextensionreplace
parallel -j1 -k -X --basenameextensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b b b b b b
parallel -k --basenameextensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b
b
b
b
b
b
echo "### Test --bner"
### Test --bner
parallel -j1 -k -X --bner FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b b b b b b
parallel -k --bner FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
b
b
b
b
b
b
echo "### Test {/}"
### Test {/}
parallel -j1 -k -X echo {/} ::: /a/b.c a/b.c b.c /a/b a/b b
b.c b.c b.c b b b
echo "### Test {/.}"
### Test {/.}
parallel -j1 -k -X echo {/.} ::: /a/b.c a/b.c b.c /a/b a/b b
b b b b b b
echo "### Test {#/.}"
### Test {#/.}
parallel -j1 -k -X echo {2/.} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
number2
echo "### Test {#/}"
### Test {#/}
parallel -j1 -k -X echo {2/} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
number2.c
echo "### Test {#.}"
### Test {#.}
parallel -j1 -k -X echo {2.} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
a/number2
echo "### bug #34241: --pipe should not spawn unneeded processes"
### bug #34241: --pipe should not spawn unneeded processes
echo | parallel -r -j2 -N1 --pipe md5sum -c && echo OK
OK
echo '### Test of quoting of > bug'
### Test of quoting of > bug
echo '>/dev/null' | parallel echo
>/dev/null
echo '### Test of quoting of > bug if line continuation'
### Test of quoting of > bug if line continuation
(echo '> '; echo '> '; echo '>') | parallel --max-lines 3 echo
> > >
echo '### Test of --trim illegal'
### Test of --trim illegal
stdout parallel --trim fj ::: echo
parallel: Error: --trim must be one of: r l rl lr.
echo '### Test of eof string on :::'
### Test of eof string on :::
parallel -k -E ole echo ::: foo ole bar
foo
echo '### Test of ignore-empty string on :::'
### Test of ignore-empty string on :::
parallel -k -r echo ::: foo '' ole bar
foo
ole
bar
echo '### Test of trailing space continuation'
### Test of trailing space continuation
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | xargs -r -L2 echo
foo ole bar
quux
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | parallel -kr -L2 echo
foo ole bar
quux
parallel -kr -L2 echo ::: foo '' 'ole ' bar quux
foo ole bar
quux
echo '### Test of trailing space continuation with -E eof'
### Test of trailing space continuation with -E eof
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | xargs -r -L2 -E bar echo
foo ole
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | parallel -kr -L2 -E bar echo
foo ole
parallel -kr -L2 -E bar echo ::: foo '' 'ole ' bar quux
foo ole
echo '### Test of --colsep'
### Test of --colsep
echo 'a%c%b' | parallel --colsep % echo {1} {3} {2}
a b c
(echo 'a%c%b'; echo a%c%b%d) | parallel -k --colsep % echo {1} {3} {2} {4}
a b c
a b c d
(echo a%c%b; echo d%f%e) | parallel -k --colsep % echo {1} {3} {2}
a b c
d e f
parallel -k --colsep % echo {1} {3} {2} ::: a%c%b d%f%e
a b c
d e f
parallel -k --colsep % echo {1} {3} {2} ::: a%c%b
a b c
parallel -k --colsep % echo {1} {3} {2} {4} ::: a%c%b a%c%b%d
a b c
a b c d
echo '### Test of tab as colsep'
### Test of tab as colsep
printf 'def\tabc\njkl\tghi' | parallel -k --colsep '\t' echo {2} {1}
abc def
ghi jkl
parallel -k -a <(printf 'def\tabc\njkl\tghi') --colsep '\t' echo {2} {1}
abc def
ghi jkl
echo '### Test of multiple -a plus colsep'
### 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}
abc def
mno jkl
echo '### Test of multiple -a no colsep'
### Test of multiple -a no colsep
parallel --xapply -k -a <(printf 'ghi\npqr\n') -a <(printf 'abc\tdef\njkl\tmno') echo {2} {1}
abc def ghi
jkl mno pqr
echo '### Test of quoting after colsplit'
### Test of quoting after colsplit
parallel --colsep % echo {2} {1} ::: '>/dev/null%>/tmp/null'
>/tmp/null >/dev/null
echo '### Test of --colsep as regexp'
### Test of --colsep as regexp
(echo 'a%c%%b'; echo a%c%b%d) | parallel -k --colsep %+ echo {1} {3} {2} {4}
a b c
a b c d
parallel -k --colsep %+ echo {1} {3} {2} {4} ::: a%c%%b a%c%b%d
a b c
a b c d
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k --colsep %+ echo {1} {3} {2} {4}
a b c
a b c d
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k --colsep %+ echo '"{1}_{3}_{2}_{4}"'
a_b_c_
a_b_c_d
echo '### Test of -C'
### Test of -C
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k -C %+ echo '"{1}_{3}_{2}_{4}"'
a_b_c_
a_b_c_d
echo '### Test of --trim n'
### Test of --trim n
(echo 'a% c %%b'; echo a%c% b %d) | parallel -k --trim n --colsep %+ echo '"{1}_{3}_{2}_{4}"'
a_b_\ c\ _
a_\ b\ _c_d
parallel -k -C %+ echo '"{1}_{3}_{2}_{4}"' ::: 'a% c %%b' 'a%c% b %d'
a_b_c_
a_b_c_d
echo '### Test of bug: If input is empty string'
### Test of bug: If input is empty string
(echo ; echo abcbdbebf;echo abc) | parallel -k --colsep b -v echo {1}{2}
echo ''
echo ac
ac
echo ac
ac
echo '### Test bug #34241: --pipe should not spawn unneeded processes'
### Test bug #34241: --pipe should not spawn unneeded processes
seq 3 | parallel -j30 --pipe --block-size 10 cat\;echo o
1
2
3
o
echo '### Test :::: mixed with :::'
### Test :::: mixed with :::
echo '### Test :::: < ::: :::'
### Test :::: < ::: :::
parallel -k echo {1} {2} {3} :::: <(seq 6 7) ::: 4 5 ::: 1 2 3
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test :::: < < :::: <'
### Test :::: < < :::: <
parallel -k echo {1} {2} {3} :::: <(seq 6 7) <(seq 4 5) :::: <(seq 1 3)
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test -a :::: < :::: <'
### Test -a :::: < :::: <
parallel -k -a <(seq 6 7) echo {1} {2} {3} :::: <(seq 4 5) :::: <(seq 1 3)
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test -a -a :::'
### Test -a -a :::
parallel -k -a <(seq 6 7) -a <(seq 4 5) echo {1} {2} {3} ::: 1 2 3
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test -a - -a :::'
### Test -a - -a :::
seq 6 7 | parallel -k -a - -a <(seq 4 5) echo {1} {2} {3} ::: 1 2 3
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test :::: < - :::'
### Test :::: < - :::
seq 4 5 | parallel -k echo {1} {2} {3} :::: <(seq 6 7) - ::: 1 2 3
6 4 1
6 4 2
6 4 3
6 5 1
6 5 2
6 5 3
7 4 1
7 4 2
7 4 3
7 5 1
7 5 2
7 5 3
echo '### Test -E'
### Test -E
seq 1 100 | parallel -k -E 5 echo :::: - ::: 2 3 4 5 6 7 8 9 10 :::: <(seq 3 11)
1 2 3
1 2 4
1 3 3
1 3 4
1 4 3
1 4 4
2 2 3
2 2 4
2 3 3
2 3 4
2 4 3
2 4 4
3 2 3
3 2 4
3 3 3
3 3 4
3 4 3
3 4 4
4 2 3
4 2 4
4 3 3
4 3 4
4 4 3
4 4 4
echo '### Test -E one empty'
### Test -E one empty
seq 1 100 | parallel -k -E 3 echo :::: - ::: 2 3 4 5 6 7 8 9 10 :::: <(seq 3 11)
1 2
2 2
echo '### Test -E 2 empty'
### Test -E 2 empty
seq 1 100 | parallel -k -E 3 echo :::: - ::: 3 4 5 6 7 8 9 10 :::: <(seq 3 11)
1
2
echo '### Test -E all empty'
### 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 {#}'
### Test {#}
seq 1 10 | parallel -k echo {#}
1
2
3
4
5
6
7
8
9
10
echo '### Test --seqreplace and line too long'
### Test --seqreplace and line too long
seq 1 1000 | stdout parallel -j1 -s 210 -k --seqreplace I echo IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII \|wc | uniq -c
9 1 1 101
90 1 1 201
1 parallel: Error: Command line too long (309 >= 210) at input 0: 100
echo '### bug #37042: -J foo is taken from the whole command line - not just the part before the command'
### bug #37042: -J foo is taken from the whole command line - not just the part before the command
echo '--tagstring foo' > ~/.parallel/bug_37042_profile; parallel -J bug_37042_profile echo ::: tag_with_foo; parallel --tagstring a -J bug_37042_profile echo ::: tag_with_a; parallel --tagstring a echo -J bug_37042_profile ::: print_-J_bug_37042_profile
foo tag_with_foo
a tag_with_a
a -J bug_37042_profile print_-J_bug_37042_profile
echo '### Bug introduce by fixing bug #37042'
### Bug introduce by fixing bug #37042
parallel --xapply -a <(printf 'abc') --colsep '\t' echo {1}
abc
echo "### Test --header with -N"
### Test --header with -N
(echo h1; echo h2; echo 1a;echo 1b; echo 2a;echo 2b; echo 3a)| parallel -j1 --pipe -N2 -k --header '.*\n.*\n' echo Start\;cat \; echo Stop
Start
h1
h2
1a
1b
Stop
Start
h1
h2
2a
2b
Stop
Start
h1
h2
3a
Stop
echo "### Test --header with --block 1k"
### Test --header with --block 1k
(echo h1; echo h2; perl -e '$a="x"x110;for(1..22){print $_,$a,"\n"'})| parallel -j1 --pipe -k --block 1k --header '.*\n.*\n' echo Start\;cat \; echo Stop
Start
h1
h2
1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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