2014-07-15 00:40:38 +00:00
|
|
|
echo 'bug #41412: --timeout + --delay causes deadlock';
|
2014-01-31 19:45:15 +00:00
|
|
|
bug #41412: --timeout + --delay causes deadlock
|
2016-08-03 21:45:13 +00:00
|
|
|
seq 10 | parallel -j10 --timeout 1 --delay 0.3 echo;
|
2014-01-31 19:45:15 +00:00
|
|
|
1
|
|
|
|
2
|
|
|
|
3
|
|
|
|
4
|
|
|
|
5
|
|
|
|
6
|
|
|
|
7
|
|
|
|
8
|
|
|
|
9
|
|
|
|
10
|
2014-07-15 00:40:38 +00:00
|
|
|
parallel -j3 --timeout 1 --delay 2 echo ::: 1 2 3;
|
2014-01-31 19:45:15 +00:00
|
|
|
1
|
|
|
|
2
|
|
|
|
3
|
2014-08-22 21:30:39 +00:00
|
|
|
parallel -j10 --timeout 2.2 --delay 3 "sleep {}; echo {}" ::: 1 2 7 8 9
|
2014-01-31 19:45:15 +00:00
|
|
|
1
|
|
|
|
2
|
2018-03-21 21:57:28 +00:00
|
|
|
parallel: Warning: This job was killed because it timed out:
|
|
|
|
parallel: Warning: sleep 7; echo 7
|
|
|
|
parallel: Warning: This job was killed because it timed out:
|
|
|
|
parallel: Warning: sleep 8; echo 8
|
|
|
|
parallel: Warning: This job was killed because it timed out:
|
|
|
|
parallel: Warning: sleep 9; echo 9
|
2015-02-01 13:38:26 +00:00
|
|
|
echo '### Test --spreadstdin - more procs than args'; rm -f /tmp/parallel.ss.*; seq 1 5 | stdout $NICEPAR -j 10 --spreadstdin 'cat >/tmp/parallel.ss.$PARALLEL_SEQ' >/dev/null; cat /tmp/parallel.ss.*; rm -f /tmp/parallel.ss.*
|
2011-01-18 22:56:28 +00:00
|
|
|
### Test --spreadstdin - more procs than args
|
|
|
|
1
|
|
|
|
2
|
|
|
|
3
|
|
|
|
4
|
|
|
|
5
|
2015-02-01 13:38:26 +00:00
|
|
|
echo '### Test --spreadstdin - more args than procs'; rm -f /tmp/parallel.ss2.*; seq 1 10 | stdout $NICEPAR -j 5 --spreadstdin 'cat >/tmp/parallel.ss2.$PARALLEL_SEQ' >/dev/null; cat /tmp/parallel.ss2.*; rm -f /tmp/parallel.ss2.*
|
2011-01-18 22:56:28 +00:00
|
|
|
### Test --spreadstdin - more args than procs
|
|
|
|
1
|
|
|
|
2
|
|
|
|
3
|
|
|
|
4
|
|
|
|
5
|
|
|
|
6
|
|
|
|
7
|
|
|
|
8
|
|
|
|
9
|
|
|
|
10
|
2014-08-22 21:30:39 +00:00
|
|
|
nice nice seq 1 1000 | $NICEPAR -j1 --spreadstdin cat "|cat "|wc -c
|
2011-01-18 22:56:28 +00:00
|
|
|
3893
|
2014-08-22 21:30:39 +00:00
|
|
|
nice nice seq 1 10000 | $NICEPAR -j10 --spreadstdin cat "|cat "|wc -c
|
2011-01-18 22:56:28 +00:00
|
|
|
48894
|
2014-08-22 21:30:39 +00:00
|
|
|
nice nice seq 1 100000 | $NICEPAR -j1 --spreadstdin cat "|cat "|wc -c
|
2011-01-18 22:56:28 +00:00
|
|
|
588895
|
2014-08-22 21:30:39 +00:00
|
|
|
nice nice seq 1 1000000 | $NICEPAR -j10 --spreadstdin cat "|cat "|wc -c
|
2011-01-18 22:56:28 +00:00
|
|
|
6888896
|
2015-02-01 15:57:31 +00:00
|
|
|
seq 1 10 | $NICEPAR --recend "\n" -j1 --spreadstdin gzip -9 >/tmp/foo.gz; rm /tmp/foo.gz
|
|
|
|
echo '### Test --spreadstdin - similar to the failing below'; nice seq 1 100000 | $NICEPAR --recend "\n" -j10 --spreadstdin gzip -9 >/tmp/foo2.gz; diff <(nice seq 1 100000) <(zcat /tmp/foo2.gz |sort -n); diff <(nice seq 1 100000|wc -c) <(zcat /tmp/foo2.gz |wc -c); rm /tmp/foo2.gz
|
2011-01-19 16:07:21 +00:00
|
|
|
### Test --spreadstdin - similar to the failing below
|
2014-08-22 21:30:39 +00:00
|
|
|
echo '### Test --spreadstdin - this failed during devel'; nice seq 1 1000000 | md5sum; nice seq 1 1000000 | $NICEPAR --recend "\n" -j10 --spreadstdin gzip -9 | zcat | sort -n | md5sum
|
2011-01-19 16:07:21 +00:00
|
|
|
### Test --spreadstdin - this failed during devel
|
|
|
|
8a7095c1c23bfadc311fe6b16d950582 -
|
|
|
|
8a7095c1c23bfadc311fe6b16d950582 -
|
2014-08-22 21:30:39 +00:00
|
|
|
echo '### Test --spreadstdin -k'; nice seq 1 1000000 | $NICEPAR -k --recend "\n" -j10 --spreadstdin gzip -9 | zcat | md5sum
|
2011-01-19 16:07:21 +00:00
|
|
|
### Test --spreadstdin -k
|
|
|
|
8a7095c1c23bfadc311fe6b16d950582 -
|
2014-08-22 21:30:39 +00:00
|
|
|
echo '### Test --spreadstdin --files'; nice seq 1 1000000 | shuf | $NICEPAR --files --recend "\n" -j10 --spreadstdin sort -n | parallel -Xj1 sort -nm {} ";"rm {} | md5sum
|
2011-01-19 16:07:21 +00:00
|
|
|
### Test --spreadstdin --files
|
|
|
|
8a7095c1c23bfadc311fe6b16d950582 -
|
2014-08-22 21:30:39 +00:00
|
|
|
echo '### Test --tag ::: a ::: b'; stdout $NICEPAR -k --tag -j1 echo stderr-{.} ">&2;" echo stdout-{} ::: a ::: b
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test --tag ::: a ::: b
|
|
|
|
a b stdout-a b
|
2013-07-19 17:13:00 +00:00
|
|
|
a b stderr-a b
|
2014-08-22 21:30:39 +00:00
|
|
|
echo '### Test --tag ::: a b'; stdout $NICEPAR -k --tag -j1 echo stderr-{.} ">&2;" echo stdout-{} ::: a b
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test --tag ::: a b
|
|
|
|
a stdout-a
|
2013-07-19 17:13:00 +00:00
|
|
|
a stderr-a
|
2012-05-13 14:03:41 +00:00
|
|
|
b stdout-b
|
2013-07-19 17:13:00 +00:00
|
|
|
b stderr-b
|
2014-08-22 21:30:39 +00:00
|
|
|
echo '### Test --tag -X ::: a b'; stdout $NICEPAR -k --tag -X -j1 echo stderr-{.} ">&2;" echo stdout-{} ::: a b
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test --tag -X ::: a b
|
|
|
|
a b stdout-a stdout-b
|
2013-07-19 17:13:00 +00:00
|
|
|
a b stderr-a stderr-b
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test bash redirection <()';
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test bash redirection <()
|
2014-08-22 21:30:39 +00:00
|
|
|
$NICEPAR 'cat <(echo {}); echo b' ::: a
|
2012-05-13 14:03:41 +00:00
|
|
|
a
|
|
|
|
b
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test bug https://savannah.gnu.org/bugs/index.php?33352'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test bug https://savannah.gnu.org/bugs/index.php?33352
|
2014-07-15 00:40:38 +00:00
|
|
|
# produce input slowly to parallel so that it will reap a process
|
|
|
|
# while blocking in read()
|
|
|
|
# Having found the solution it is suddenly very easy to reproduce the
|
|
|
|
# problem - even on other hardware:
|
|
|
|
#
|
|
|
|
# perl -e '@x=1 .. 17000; for(1..30) { print "@x\n"}' | pv -qL 200000
|
|
|
|
# |parallel -j2 --pipe --keeporder --block 150000 cat | md5sum
|
|
|
|
#
|
|
|
|
# This gives different md5sums for each run.
|
|
|
|
#
|
|
|
|
# The problem is that read(STDIN) is being interrupted by a dead
|
|
|
|
# child. The chance of this happening is very small if there are few
|
|
|
|
# children dying or read(STDIN) never has to wait for data.
|
|
|
|
#
|
|
|
|
# The test above forces data to arrive slowly (using pv) which causes
|
|
|
|
# read(STDIN) to take a long time - thus being interrupted by a dead
|
|
|
|
# child.
|
|
|
|
echo "# md5sum - directly"
|
2012-12-28 20:30:30 +00:00
|
|
|
# md5sum - directly
|
2014-08-22 21:30:39 +00:00
|
|
|
nice perl -e '@x=1 .. 17000; for(1..100) { print "@x\n"}' | md5sum
|
2012-05-13 14:03:41 +00:00
|
|
|
350eda13a37912d755c9d733d149bdaf -
|
2014-07-15 00:40:38 +00:00
|
|
|
echo "# parallel | md5sum"
|
2012-12-28 20:30:30 +00:00
|
|
|
# parallel | md5sum
|
2014-07-15 00:40:38 +00:00
|
|
|
nice nice perl -e '@x=1 .. 17000; for(1..100) { print "@x\n"}' | pv -qL 1000000 | $PAR cat | md5sum
|
2012-05-13 14:03:41 +00:00
|
|
|
350eda13a37912d755c9d733d149bdaf -
|
2014-07-15 00:40:38 +00:00
|
|
|
echo "# --recend ''"
|
2012-12-28 20:30:30 +00:00
|
|
|
# --recend ''
|
2014-07-15 00:40:38 +00:00
|
|
|
nice nice perl -e '@x=1 .. 17000; for(1..100) { print "@x\n"}' | pv -qL 1000000 | $PAR --recend '' cat | md5sum
|
2012-05-13 14:03:41 +00:00
|
|
|
350eda13a37912d755c9d733d149bdaf -
|
2014-07-15 00:40:38 +00:00
|
|
|
echo "# --recend '' --files"
|
2012-12-28 20:30:30 +00:00
|
|
|
# --recend '' --files
|
2014-07-15 00:40:38 +00:00
|
|
|
nice nice perl -e '@x=1 .. 17000; for(1..100) { print "@x\n"}' | pv -qL 1000000 | $PAR --recend '' --files cat | parallel -Xj1 cat {} ';' rm {} | md5sum
|
2012-05-13 14:03:41 +00:00
|
|
|
350eda13a37912d755c9d733d149bdaf -
|
2014-07-15 00:40:38 +00:00
|
|
|
echo "# --recend '' --files --tmpdir"
|
2012-12-28 20:30:30 +00:00
|
|
|
# --recend '' --files --tmpdir
|
2014-07-15 00:40:38 +00:00
|
|
|
nice nice perl -e '@x=1 .. 17000; for(1..100) { print "@x\n"}' | pv -qL 1000000 | $PAR --recend '' --files --tmpdir /dev/shm cat | parallel -Xj1 cat {} ';' rm {} | md5sum
|
2012-05-13 14:03:41 +00:00
|
|
|
350eda13a37912d755c9d733d149bdaf -
|
2014-07-15 00:40:38 +00:00
|
|
|
echo "# --recend '' --files --halt-on-error"
|
2012-12-28 20:30:30 +00:00
|
|
|
# --recend '' --files --halt-on-error
|
2014-07-15 00:40:38 +00:00
|
|
|
nice nice perl -e '@x=1 .. 17000; for(1..100) { print "@x\n"}' | pv -qL 1000000 | $PAR --recend '' --files --halt-on-error 2 cat | parallel -Xj1 cat {} ';' rm {} | md5sum
|
2012-05-13 14:03:41 +00:00
|
|
|
350eda13a37912d755c9d733d149bdaf -
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test of -j filename - non-existent file'; nice stdout parallel -j no_such_file echo ::: 1
|
2012-08-06 22:52:08 +00:00
|
|
|
### Test of -j filename - non-existent file
|
2015-05-15 06:47:44 +00:00
|
|
|
parallel: Error: Parsing of --jobs/-j/--max-procs/-P failed.
|
2012-05-13 14:03:41 +00:00
|
|
|
Usage:
|
2014-07-26 11:17:13 +00:00
|
|
|
|
2012-05-13 14:03:41 +00:00
|
|
|
parallel [options] [command [arguments]] < list_of_arguments
|
|
|
|
parallel [options] [command [arguments]] (::: arguments|:::: argfile(s))...
|
|
|
|
cat ... | parallel --pipe [options] [command [arguments]]
|
|
|
|
|
2014-07-26 11:17:13 +00:00
|
|
|
-j n Run n jobs in parallel
|
|
|
|
-k Keep same order
|
|
|
|
-X Multiple arguments with context replace
|
|
|
|
--colsep regexp Split input on regexp for positional replacements
|
|
|
|
{} {.} {/} {/.} {#} {%} {= perl code =} Replacement strings
|
|
|
|
{3} {3.} {3/} {3/.} {=3 perl code =} Positional replacement strings
|
|
|
|
With --plus: {} = {+/}/{/} = {.}.{+.} = {+/}/{/.}.{+.} = {..}.{+..} =
|
|
|
|
{+/}/{/..}.{+..} = {...}.{+...} = {+/}/{/...}.{+...}
|
2012-05-13 14:03:41 +00:00
|
|
|
|
2014-07-26 11:17:13 +00:00
|
|
|
-S sshlogin Example: foo@server.example.com
|
|
|
|
--slf .. Use ~/.parallel/sshloginfile as the list of sshlogins
|
|
|
|
--trc {}.bar Shorthand for --transfer --return {}.bar --cleanup
|
|
|
|
--onall Run the given command with argument on all sshlogins
|
|
|
|
--nonall Run the given command with no arguments on all sshlogins
|
2012-05-13 14:03:41 +00:00
|
|
|
|
2014-07-26 11:17:13 +00:00
|
|
|
--pipe Split stdin (standard input) to multiple jobs.
|
|
|
|
--recend str Record end separator for --pipe.
|
|
|
|
--recstart str Record start separator for --pipe.
|
2012-05-13 14:03:41 +00:00
|
|
|
|
|
|
|
See 'man parallel' for details
|
|
|
|
|
2014-12-26 17:31:06 +00:00
|
|
|
Academic tradition requires you to cite works you base your article on.
|
2017-06-23 21:00:05 +00:00
|
|
|
If you use programs that use GNU Parallel to process data for an article in a
|
|
|
|
scientific publication, please cite:
|
2012-05-13 14:03:41 +00:00
|
|
|
|
2018-04-22 14:28:01 +00:00
|
|
|
O. Tange (2018): GNU Parallel 2018, Mar 2018, ISBN 9781387509881,
|
2018-04-20 21:29:44 +00:00
|
|
|
DOI https://doi.org/10.5281/zenodo.1146014
|
2014-10-09 20:21:28 +00:00
|
|
|
|
2015-11-29 23:47:21 +00:00
|
|
|
This helps funding further development; AND IT WON'T COST YOU A CENT.
|
2014-12-26 17:31:06 +00:00
|
|
|
If you pay 10000 EUR you should feel free to use GNU Parallel without citing.
|
|
|
|
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test of -j filename'; echo 3 >/tmp/jobs_to_run1; parallel -j /tmp/jobs_to_run1 -v sleep {} ::: 10 8 6 5 4; # Should give 6 8 10 5 4
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test of -j filename
|
2012-08-08 21:57:01 +00:00
|
|
|
sleep 6
|
|
|
|
sleep 8
|
|
|
|
sleep 10
|
|
|
|
sleep 5
|
|
|
|
sleep 4
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test ::::'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test ::::
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Change --arg-file-sep'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Change --arg-file-sep
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP --arg-file-sep :::: -k echo {1} {2} :::: <(seq 1 10) <(seq 5 15)
|
2012-05-13 14:03:41 +00:00
|
|
|
1 5
|
|
|
|
2 6
|
|
|
|
3 7
|
|
|
|
4 8
|
|
|
|
5 9
|
|
|
|
6 10
|
|
|
|
7 11
|
|
|
|
8 12
|
|
|
|
9 13
|
|
|
|
10 14
|
2013-06-22 12:50:48 +00:00
|
|
|
1 15
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP --arg-file-sep .--- -k echo {1} {2} .--- <(seq 1 10) <(seq 5 15)
|
2012-05-13 14:03:41 +00:00
|
|
|
1 5
|
|
|
|
2 6
|
|
|
|
3 7
|
|
|
|
4 8
|
|
|
|
5 9
|
|
|
|
6 10
|
|
|
|
7 11
|
|
|
|
8 12
|
|
|
|
9 13
|
|
|
|
10 14
|
2013-06-22 12:50:48 +00:00
|
|
|
1 15
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP --argfilesep :::: -k echo {1} {2} :::: <(seq 1 10) <(seq 5 15)
|
2012-05-13 14:03:41 +00:00
|
|
|
1 5
|
|
|
|
2 6
|
|
|
|
3 7
|
|
|
|
4 8
|
|
|
|
5 9
|
|
|
|
6 10
|
|
|
|
7 11
|
|
|
|
8 12
|
|
|
|
9 13
|
|
|
|
10 14
|
2013-06-22 12:50:48 +00:00
|
|
|
1 15
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP --argfilesep .--- -k echo {1} {2} .--- <(seq 1 10) <(seq 5 15)
|
2012-05-13 14:03:41 +00:00
|
|
|
1 5
|
|
|
|
2 6
|
|
|
|
3 7
|
|
|
|
4 8
|
|
|
|
5 9
|
|
|
|
6 10
|
|
|
|
7 11
|
|
|
|
8 12
|
|
|
|
9 13
|
|
|
|
10 14
|
2013-06-22 12:50:48 +00:00
|
|
|
1 15
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test xapply --max-replace-args'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test xapply --max-replace-args
|
2014-07-15 00:40:38 +00:00
|
|
|
seq 0 7 | $XAP -k --max-replace-args=3 echo {3} {2} {1}
|
2012-05-13 14:03:41 +00:00
|
|
|
2 1 0
|
|
|
|
5 4 3
|
|
|
|
7 6
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test -N'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test -N
|
2014-07-15 00:40:38 +00:00
|
|
|
seq 1 5 | $XAP -kN3 echo {1} {2} {3}
|
2012-05-13 14:03:41 +00:00
|
|
|
1 2 3
|
|
|
|
4 5
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test -N with 0'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test -N with 0
|
2014-07-15 00:40:38 +00:00
|
|
|
seq 0 7 | $XAP -kN3 echo {1} {2} {3}
|
2012-05-13 14:03:41 +00:00
|
|
|
0 1 2
|
|
|
|
3 4 5
|
|
|
|
6 7
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test :::: on nonexistent'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test :::: on nonexistent
|
2014-07-15 00:40:38 +00:00
|
|
|
stdout $XAP -k echo {1} {2} {3} :::: nonexistent
|
2012-08-08 16:38:29 +00:00
|
|
|
parallel: Error: Cannot open input file `nonexistent': No such file or directory.
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test :::: two files'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test :::: two files
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -k echo {1} {2} :::: <(seq 1 10) <(seq 5 15)
|
2012-05-13 14:03:41 +00:00
|
|
|
1 5
|
|
|
|
2 6
|
|
|
|
3 7
|
|
|
|
4 8
|
|
|
|
5 9
|
|
|
|
6 10
|
|
|
|
7 11
|
|
|
|
8 12
|
|
|
|
9 13
|
|
|
|
10 14
|
2013-06-22 12:50:48 +00:00
|
|
|
1 15
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test -d, ::::'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test -d, ::::
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kd, 'echo a{1} {2}b' :::: <(echo 1,2,3,) <(echo 5,6,7,8)
|
2012-05-13 14:03:41 +00:00
|
|
|
a1 5b
|
|
|
|
a2 6b
|
|
|
|
a3 7b
|
|
|
|
a
|
|
|
|
8
|
|
|
|
b
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test -d, :::: one file too much'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test -d, :::: one file too much
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kd, echo 'a{1}' '{2}b' :::: <(echo 1,2,3,) <(echo 5,6,7,8) <(echo 9,0)
|
2012-05-13 14:03:41 +00:00
|
|
|
a1 5b
|
|
|
|
a2 6b
|
|
|
|
a3 7b
|
|
|
|
a
|
|
|
|
8
|
|
|
|
b
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Bug: did not quote'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Bug: did not quote
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP echo {1} {2} :::: <(echo '>') <(echo b)
|
2012-05-13 14:03:41 +00:00
|
|
|
> b
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Quote test triplet 1'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Quote test triplet 1
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv :::: <(echo 'echo a'; echo 'echo b')
|
2012-05-13 14:03:41 +00:00
|
|
|
echo a
|
|
|
|
a
|
|
|
|
echo b
|
|
|
|
b
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv -a <(echo 'echo a'; echo 'echo b')
|
2012-05-13 14:03:41 +00:00
|
|
|
echo a
|
|
|
|
a
|
|
|
|
echo b
|
|
|
|
b
|
2014-07-15 00:40:38 +00:00
|
|
|
(echo 'echo a'; echo 'echo b') | $XAP -kv
|
2012-05-13 14:03:41 +00:00
|
|
|
echo a
|
|
|
|
a
|
|
|
|
echo b
|
|
|
|
b
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Quote test triplet 2'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Quote test triplet 2
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv echo :::: <(echo 'echo a'; echo 'echo b')
|
2018-07-22 06:58:32 +00:00
|
|
|
echo 'echo a'
|
2012-05-13 14:03:41 +00:00
|
|
|
echo a
|
2018-07-22 06:58:32 +00:00
|
|
|
echo 'echo b'
|
2012-05-13 14:03:41 +00:00
|
|
|
echo b
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv -a <(echo 'echo a'; echo 'echo b') echo
|
2018-07-22 06:58:32 +00:00
|
|
|
echo 'echo a'
|
2012-05-13 14:03:41 +00:00
|
|
|
echo a
|
2018-07-22 06:58:32 +00:00
|
|
|
echo 'echo b'
|
2012-05-13 14:03:41 +00:00
|
|
|
echo b
|
2014-07-15 00:40:38 +00:00
|
|
|
(echo 'echo a'; echo 'echo b') | $XAP -kv echo
|
2018-07-22 06:58:32 +00:00
|
|
|
echo 'echo a'
|
2012-05-13 14:03:41 +00:00
|
|
|
echo a
|
2018-07-22 06:58:32 +00:00
|
|
|
echo 'echo b'
|
2012-05-13 14:03:41 +00:00
|
|
|
echo b
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Quoting if there is a command and 2 arg files'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Quoting if there is a command and 2 arg files
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv echo :::: <(echo 'echo a') <(echo 'echo b')
|
2018-07-22 06:58:32 +00:00
|
|
|
echo 'echo a' 'echo b'
|
2012-05-13 14:03:41 +00:00
|
|
|
echo a echo b
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Quoting if there is a command and 2 arg files of uneven length'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Quoting if there is a command and 2 arg files of uneven length
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv echo :::: <(echo 'echo a';echo a1) <(echo 'echo b')
|
2018-07-22 06:58:32 +00:00
|
|
|
echo 'echo a' 'echo b'
|
2012-05-13 14:03:41 +00:00
|
|
|
echo a echo b
|
2018-07-22 06:58:32 +00:00
|
|
|
echo a1 'echo b'
|
2013-06-22 12:50:48 +00:00
|
|
|
a1 echo b
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Quoting if there is no command and 2 arg files'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Quoting if there is no command and 2 arg files
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv :::: <(echo 'echo a') <(echo 'echo b')
|
2012-05-13 14:03:41 +00:00
|
|
|
echo a echo b
|
|
|
|
a echo b
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Quoting if there is no command and 2 arg files of uneven length'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Quoting if there is no command and 2 arg files of uneven length
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv :::: <(echo 'echo a';echo echo a1) <(echo 'echo b')
|
2012-05-13 14:03:41 +00:00
|
|
|
echo a echo b
|
|
|
|
a echo b
|
2013-06-22 12:50:48 +00:00
|
|
|
echo a1 echo b
|
|
|
|
a1 echo b
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test multiple -a'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test multiple -a
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv -a <(echo a) -a <(echo b) echo {2} {1}
|
2012-05-13 14:03:41 +00:00
|
|
|
echo b a
|
|
|
|
b a
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv echo {2} {1} :::: <(echo a) <(echo b)
|
2012-05-13 14:03:41 +00:00
|
|
|
echo b a
|
|
|
|
b a
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Multiple -a: An unused file'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Multiple -a: An unused file
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv -a <(echo a) -a <(echo b) -a <(echo c) echo {2} {1}
|
2012-05-13 14:03:41 +00:00
|
|
|
echo b a
|
|
|
|
b a
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv echo {2} {1} :::: <(echo a) <(echo b) <(echo c)
|
2012-05-13 14:03:41 +00:00
|
|
|
echo b a
|
|
|
|
b a
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Multiple -a: nonexistent'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Multiple -a: nonexistent
|
2014-07-15 00:40:38 +00:00
|
|
|
stdout $XAP -kv echo {2} {1} :::: nonexist nonexist2
|
2012-08-08 16:38:29 +00:00
|
|
|
parallel: Error: Cannot open input file `nonexist': No such file or directory.
|
2014-07-15 00:40:38 +00:00
|
|
|
stdout $XAP -kv -a nonexist -a nonexist2 echo {2} {1}
|
2012-08-08 16:38:29 +00:00
|
|
|
parallel: Error: Cannot open input file `nonexist': No such file or directory.
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test {#.}'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test {#.}
|
2014-07-15 00:40:38 +00:00
|
|
|
$XAP -kv -a <(echo a-noext) -a <(echo b-withext.extension) -a <(echo c-ext.gif) echo {3.} {2.} {1.}
|
2012-05-13 14:03:41 +00:00
|
|
|
echo c-ext b-withext a-noext
|
|
|
|
c-ext b-withext a-noext
|
2014-07-15 00:40:38 +00:00
|
|
|
echo "### Tests that failed for OO-rewrite"
|
2012-05-13 14:03:41 +00:00
|
|
|
### Tests that failed for OO-rewrite
|
2019-05-22 19:57:08 +00:00
|
|
|
parallel -u --semaphore --id local9 seq 1 10 '|' pv -qL 20; sem --id local9 --wait; echo done
|
2012-05-13 14:03:41 +00:00
|
|
|
1
|
|
|
|
2
|
|
|
|
3
|
|
|
|
4
|
|
|
|
5
|
|
|
|
6
|
|
|
|
7
|
|
|
|
8
|
|
|
|
9
|
|
|
|
10
|
|
|
|
done
|
2014-07-15 00:40:38 +00:00
|
|
|
echo a | parallel echo {1}
|
2012-05-13 14:03:41 +00:00
|
|
|
a
|
2014-07-15 00:40:38 +00:00
|
|
|
echo "echo a" | parallel
|
2012-05-13 14:03:41 +00:00
|
|
|
a
|
2014-08-22 21:30:39 +00:00
|
|
|
nice parallel -j1 -I :: -X echo 'a::b::^c::[.}c' ::: 1
|
2012-05-13 14:03:41 +00:00
|
|
|
a1b1^c1[.}c
|
2014-07-15 00:40:38 +00:00
|
|
|
echo "### BUG: The length for -X is not close to max (131072)"
|
2012-05-13 14:03:41 +00:00
|
|
|
### BUG: The length for -X is not close to max (131072)
|
2014-08-22 21:30:39 +00:00
|
|
|
seq 1 4000 | nice parallel -k -X echo {.} aa {}{.} {}{}d{} {}dd{}d{.} |head -n 1 |wc
|
2017-08-19 23:15:28 +00:00
|
|
|
1 12817 131016
|
2014-07-15 00:40:38 +00:00
|
|
|
echo "### BUG: empty lines with --show-limit"
|
2012-05-13 14:03:41 +00:00
|
|
|
### BUG: empty lines with --show-limit
|
2014-08-22 21:30:39 +00:00
|
|
|
echo | $NICEPAR --show-limits
|
2016-05-17 00:11:38 +00:00
|
|
|
Maximal size of command: 131049
|
2020-02-23 00:10:44 +00:00
|
|
|
Maximal used size of command: 131057
|
2012-05-13 14:03:41 +00:00
|
|
|
|
|
|
|
Execution of will continue now, and it will try to read its input
|
|
|
|
and run commands; if this is not what you wanted to happen, please
|
|
|
|
press CTRL-D or CTRL-C
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test -N'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test -N
|
2014-08-22 21:30:39 +00:00
|
|
|
seq 1 5 | $NICEPAR -kN3 echo {1} {2} {3}
|
2012-05-13 14:03:41 +00:00
|
|
|
1 2 3
|
|
|
|
4 5
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test --arg-file-sep with files of different lengths'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test --arg-file-sep with files of different lengths
|
2014-08-22 21:30:39 +00:00
|
|
|
$XAP --arg-file-sep :::: -k echo {1} {2} :::: <(seq 1 1) <(seq 3 4)
|
2012-05-13 14:03:41 +00:00
|
|
|
1 3
|
2013-06-22 12:50:48 +00:00
|
|
|
1 4
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test respect -s'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test respect -s
|
2014-08-22 21:30:39 +00:00
|
|
|
$NICEPAR -kvm -IARG -s15 echo ARG ::: 1 22 333 4444 55555 666666 7777777 88888888 999999999
|
2012-05-13 14:03:41 +00:00
|
|
|
echo 1 22 333
|
|
|
|
1 22 333
|
|
|
|
echo 4444
|
|
|
|
4444
|
|
|
|
echo 55555
|
|
|
|
55555
|
|
|
|
echo 666666
|
|
|
|
666666
|
|
|
|
echo 7777777
|
|
|
|
7777777
|
|
|
|
echo 88888888
|
|
|
|
88888888
|
|
|
|
echo 999999999
|
|
|
|
999999999
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test eof string after :::'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test eof string after :::
|
2014-08-22 21:30:39 +00:00
|
|
|
$NICEPAR -k -E ole echo ::: foo ole bar
|
2012-05-13 14:03:41 +00:00
|
|
|
foo
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test -C and --trim rl'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test -C and --trim rl
|
2014-08-22 21:30:39 +00:00
|
|
|
$NICEPAR -k -C %+ echo '"{1}_{3}_{2}_{4}"' ::: 'a% c %%b' 'a%c% b %d'
|
2014-07-14 16:25:45 +00:00
|
|
|
a_b_c_
|
2012-05-13 14:03:41 +00:00
|
|
|
a_b_c_d
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test empty input'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test empty input
|
2014-08-22 21:30:39 +00:00
|
|
|
</dev/null $NICEPAR -j +0 echo
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test -m'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test -m
|
2014-08-22 21:30:39 +00:00
|
|
|
seq 1 2 | $NICEPAR -k -m echo
|
2012-05-13 14:03:41 +00:00
|
|
|
1
|
|
|
|
2
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test :::'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test :::
|
2014-08-22 21:30:39 +00:00
|
|
|
$NICEPAR echo ::: 1
|
2012-05-13 14:03:41 +00:00
|
|
|
1
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test context_replace'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test context_replace
|
2014-08-22 21:30:39 +00:00
|
|
|
echo a | $NICEPAR -qX echo "'"{}"' "
|
2012-05-13 14:03:41 +00:00
|
|
|
'a'
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test -N2 {2}'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test -N2 {2}
|
2014-08-22 21:30:39 +00:00
|
|
|
seq 1 4 | $NICEPAR -kN2 echo arg1:{1} seq:'$'PARALLEL_SEQ arg2:{2}
|
2012-05-13 14:03:41 +00:00
|
|
|
arg1:1 seq:1 arg2:2
|
|
|
|
arg1:3 seq:2 arg2:4
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test -E (should only output foo ole)'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test -E (should only output foo ole)
|
2014-08-22 21:30:39 +00:00
|
|
|
(echo foo; echo '';echo 'ole ';echo bar;echo quux) | $NICEPAR -kr -L2 -E bar echo
|
2012-05-13 14:03:41 +00:00
|
|
|
foo ole
|
2014-08-22 21:30:39 +00:00
|
|
|
$NICEPAR -kr -L2 -E bar echo ::: foo '' 'ole ' bar quux
|
2012-05-13 14:03:41 +00:00
|
|
|
foo ole
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test -r (should only output foo ole bar\nquux)'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test -r (should only output foo ole bar\nquux)
|
2014-08-22 21:30:39 +00:00
|
|
|
$NICEPAR -kr -L2 echo ::: foo '' 'ole ' bar quux
|
2012-05-13 14:03:41 +00:00
|
|
|
foo ole bar
|
|
|
|
quux
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test of tab as colsep'
|
2012-05-13 14:03:41 +00:00
|
|
|
### Test of tab as colsep
|
2014-08-22 21:30:39 +00:00
|
|
|
printf 'def\tabc\njkl\tghi' | $NICEPAR -k --colsep '\t' echo {2} {1}
|
2012-05-13 14:03:41 +00:00
|
|
|
abc def
|
|
|
|
ghi jkl
|
2014-08-22 21:30:39 +00:00
|
|
|
$NICEPAR -k -a <(printf 'def\tabc\njkl\tghi') --colsep '\t' echo {2} {1}
|
2012-05-13 14:03:41 +00:00
|
|
|
abc def
|
|
|
|
ghi jkl
|
2014-04-22 10:03:41 +00:00
|
|
|
### Test of -j filename with file content changing (missing -k is correct)
|
2012-05-13 14:03:41 +00:00
|
|
|
sleep 3.3
|
|
|
|
sleep 1
|
|
|
|
sleep 1
|
|
|
|
sleep 1
|
|
|
|
sleep 1
|
|
|
|
sleep 1
|
|
|
|
sleep 1
|
2013-05-26 06:26:18 +00:00
|
|
|
sleep 1.5
|
|
|
|
sleep 1.5
|
|
|
|
sleep 1.5
|
|
|
|
sleep 1.5
|
2012-05-13 14:03:41 +00:00
|
|
|
sleep 1
|
|
|
|
sleep 1
|
|
|
|
sleep 1
|
|
|
|
sleep 1
|
|
|
|
sleep 1
|