{= perlexpr =} passes testsuite.

This commit is contained in:
Ole Tange 2014-07-14 18:25:45 +02:00
parent 0725d2e2f5
commit 4995630a62
27 changed files with 671 additions and 617 deletions

View file

@ -24,7 +24,7 @@
use strict;
use Getopt::Long;
$Global::progname="niceload";
$Global::version = 20140622;
$Global::version = 20140711;
Getopt::Long::Configure("bundling","require_order");
get_options_from_array(\@ARGV) || die_usage();
if($opt::version) {

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -93,8 +93,9 @@ B<exportf> to export and to set $SHELL to bash:
exportf my_func
SHELL=/bin/bash parallel "my_func {}" ::: 1 2
The command cannot contain the character \257 (¯).
=item B<{}>
=item B<{}> (alpha testing)
Input line. This replacement string will be replaced by a full line
read from the input source. The input source is normally stdin
@ -107,7 +108,7 @@ If the command line contains no replacement strings then B<{}> will be
appended to the command line.
=item B<{.}>
=item B<{.}> (alpha testing)
Input line without extension. This replacement string will be replaced
by the input with the extension removed. If the input line contains
@ -123,7 +124,7 @@ The replacement string B<{.}> can be changed with B<--er>.
To understand replacement strings see B<{}>.
=item B<{/}>
=item B<{/}> (alpha testing)
Basename of input line. This replacement string will be replaced by
the input with the directory part removed.
@ -134,7 +135,7 @@ B<--basenamereplace>.
To understand replacement strings see B<{}>.
=item B<{//}>
=item B<{//}> (alpha testing)
Dirname of input line. This replacement string will be replaced by the
dir of the input line. See B<dirname>(1).
@ -145,7 +146,7 @@ B<--dirnamereplace>.
To understand replacement strings see B<{}>.
=item B<{/.}>
=item B<{/.}> (alpha testing)
Basename of input line without extension. This replacement string will
be replaced by the input with the directory and extension part
@ -157,7 +158,7 @@ B<--basenameextensionreplace>.
To understand replacement strings see B<{}>.
=item B<{#}>
=item B<{#}> (alpha testing)
Sequence number of the job to run. This replacement string will be
replaced by the sequence number of the job being run. It contains the
@ -243,6 +244,27 @@ directory (if any) and extension removed.
To understand positional replacement strings see B<{>I<n>B<}>.
=item B<{=>I<perl expression>B<=}>
Replace with calculated I<perl expression>. B<$_> will contain the
same as B<{}>. After evaluating I<perl expression> B<$_> will be used
as the value. It is recommended to only change $_ but you have full
access to all of GNU B<parallel>'s internal functions and data
structures.
The B<{=>I<perl expression>B<=}> must be given as a single string.
See also: B<--rpl> B<--parens>
=item B<{=>I<n> I<perl expression>B<=}>
Positional equivalent to B<{= perl expression =}>. To understand
positional replacement strings see B<{>I<n>B<}>.
See also: B<{= perl expression =}> B<{>I<n>B<}>.
=item B<:::> I<arguments>
Use arguments from the command line as input source instead of stdin
@ -800,7 +822,7 @@ B<-l 0> is an alias for B<-l 1>.
Implies B<-X> unless B<-m>, B<--xargs>, or B<--pipe> is set.
=item B<--line-buffer> (beta testing)
=item B<--line-buffer>
Buffer output on line basis. B<--group> will keep the output together
for a whole job. B<--ungroup> allows output to mixup with half a line
@ -935,7 +957,7 @@ B<--files> is often used with B<--pipe>.
See also: B<--recstart>, B<--recend>, B<--fifo>, B<--cat>, B<--pipepart>.
=item B<--pipepart> (alpha testing)
=item B<--pipepart> (beta testing)
Pipe parts of a physical file. B<--pipepart> works similar to
B<--pipe>, but is much faster. It has a few limitations:
@ -1058,6 +1080,21 @@ from the terminal. Only run the command line if the response starts
with 'y' or 'Y'. Implies B<-t>.
=item B<--parens> I<parensstring> (alpha testing)
Use to define start and end parenthesis for B<{= perl expression =}>. The
left and the right parenthesis can be multiple characters and are
assumed to be the same length. The default is B<{==}> giving
B<{=> as the start parenthesis and B<=}> as the end parenthesis.
Another useful setting is B<,,,,> which would make both parenthesis
B<,,>:
parallel --parens ,,,, echo foo is ,,s/I/O/g,, ::: FII
See also: B<--rpl> B<{= perl expression =}>
=item B<--profile> I<profilename>
=item B<-J> I<profilename>
@ -1281,6 +1318,29 @@ B<--keep-order> will not work with B<--round-robin> as it is
impossible to track which input block corresponds to which output.
=item B<--rpl> 'I<tag> I<perl expression>' (alpha testing)
Use I<tag> as a replacement string for I<perl expression>. This makes
it possible to define your own replacement strings. GNU B<parallel>'s
7 replacement strings are implemented as:
--rpl '{} '
--rpl '{#} $_=$job->seq()'
--rpl '{%} $_=$job->slot()'
--rpl '{/} s:.*/::'
--rpl '{//} $Global::use{"File::Basename"} ||= eval "use File::Basename; 1;"; $_ = dirname($_);'
--rpl '{/.} s:.*/::; s:\.[^/.]+$::;'
--rpl '{.} s:\.[^/.]+$::'
If the user defined replacement string starts with '{' it can also be
used as a positional replacement string (like B<{2.}>).
It is recommended to only change $_ but you have full access to all
of GNU B<parallel>'s internal functions and data structures.
See also: B<{= perl expression =}> B<--parens>
=item B<--max-chars>=I<max-chars>
=item B<-s> I<max-chars>
@ -1302,7 +1362,7 @@ operating system and the B<-s> option. Pipe the input from /dev/null
to do anything.
=item B<--semaphore> (beta testing)
=item B<--semaphore>
Work as a counting semaphore. B<--semaphore> will cause GNU
B<parallel> to start I<command> in the background. When the number of
@ -1339,7 +1399,7 @@ Implies B<--semaphore>.
See also B<man sem>.
=item B<--semaphoretimeout> I<secs> (beta testing)
=item B<--semaphoretimeout> I<secs>
If the semaphore is not released within secs seconds, take it anyway.
@ -1508,7 +1568,7 @@ The sshloginfile '-' is special, too, it read sshlogins from stdin
(standard input).
=item B<--slotreplace> I<replace-str> (beta testing)
=item B<--slotreplace> I<replace-str>
Use the replacement string I<replace-str> instead of B<{%}> for
job slot number.
@ -1998,6 +2058,15 @@ B<$(date -d "today -{1} days" +%Y%m%d)> will give the dates in
YYYYMMDD with {1} days subtracted.
=head1 EXAMPLE: Digtal clock with "blinking" :
The : in a digital clock blinks. To make every other line have a ':'
and the rest a ' ' a perl expression is used to look at the 3rd input
source. If the value modudo 2 is 1: Use ":" otherwise use " ":
B<parallel -k echo {1}'{=3 $_=$_%2?":":" "=}'{2}{3} ::: {0..12} ::: {0..5} ::: {0..9}>
=head1 EXAMPLE: Breadth first parallel web crawler/mirrorer
This script below will crawl and mirror a URL in parallel. It
@ -2715,7 +2784,7 @@ B<echo my_command my_arg >>>B< jobqueue>
You can of course use B<-S> to distribute the jobs to remote
computers:
B<echo >>B<jobqueue>; B<tail -f jobqueue | parallel -S ..>
B<true >>B<jobqueue>; B<tail -f jobqueue | parallel -S ..>
There is a a small issue when using GNU B<parallel> as queue
system/batch manager: You have to submit JobSlot number of jobs before

View file

@ -24,6 +24,7 @@
* EXAMPLE@asis{:} Removing file extension when processing files::
* EXAMPLE@asis{:} Removing two file extensions when processing files and calling GNU Parallel from itself::
* EXAMPLE@asis{:} Download 10 images for each of the past 30 days::
* EXAMPLE@asis{:} Digtal clock with "blinking" @asis{:}::
* EXAMPLE@asis{:} Breadth first parallel web crawler/mirrorer::
* EXAMPLE@asis{:} Process files from a tar file while unpacking::
* EXAMPLE@asis{:} Rewriting a for-loop and a while-read-loop::
@ -170,8 +171,10 @@ If it is a zsh function you will need to use this helper function
SHELL=/bin/bash parallel "my_func {}" ::: 1 2
@end verbatim
@item @strong{@{@}}
@anchor{@strong{@{@}}}
The command cannot contain the character \257 (¯).
@item @strong{@{@}} (alpha testing)
@anchor{@strong{@{@}} (alpha testing)}
Input line. This replacement string will be replaced by a full line
read from the input source. The input source is normally stdin
@ -183,8 +186,8 @@ The replacement string @strong{@{@}} can be changed with @strong{-I}.
If the command line contains no replacement strings then @strong{@{@}} will be
appended to the command line.
@item @strong{@{.@}}
@anchor{@strong{@{.@}}}
@item @strong{@{.@}} (alpha testing)
@anchor{@strong{@{.@}} (alpha testing)}
Input line without extension. This replacement string will be replaced
by the input with the extension removed. If the input line contains
@ -199,8 +202,8 @@ The replacement string @strong{@{.@}} can be changed with @strong{--er}.
To understand replacement strings see @strong{@{@}}.
@item @strong{@{/@}}
@anchor{@strong{@{/@}}}
@item @strong{@{/@}} (alpha testing)
@anchor{@strong{@{/@}} (alpha testing)}
Basename of input line. This replacement string will be replaced by
the input with the directory part removed.
@ -210,8 +213,8 @@ The replacement string @strong{@{/@}} can be changed with
To understand replacement strings see @strong{@{@}}.
@item @strong{@{//@}}
@anchor{@strong{@{//@}}}
@item @strong{@{//@}} (alpha testing)
@anchor{@strong{@{//@}} (alpha testing)}
Dirname of input line. This replacement string will be replaced by the
dir of the input line. See @strong{dirname}(1).
@ -221,8 +224,8 @@ The replacement string @strong{@{//@}} can be changed with
To understand replacement strings see @strong{@{@}}.
@item @strong{@{/.@}}
@anchor{@strong{@{/.@}}}
@item @strong{@{/.@}} (alpha testing)
@anchor{@strong{@{/.@}} (alpha testing)}
Basename of input line without extension. This replacement string will
be replaced by the input with the directory and extension part
@ -233,8 +236,8 @@ The replacement string @strong{@{/.@}} can be changed with
To understand replacement strings see @strong{@{@}}.
@item @strong{@{#@}}
@anchor{@strong{@{#@}}}
@item @strong{@{#@}} (alpha testing)
@anchor{@strong{@{#@}} (alpha testing)}
Sequence number of the job to run. This replacement string will be
replaced by the sequence number of the job being run. It contains the
@ -319,6 +322,27 @@ directory (if any) and extension removed.
To understand positional replacement strings see @strong{@{}@emph{n}@strong{@}}.
@item @strong{@{=}@emph{perl expression}@strong{=@}}
@anchor{@strong{@{=}@emph{perl expression}@strong{=@}}}
Replace with calculated @emph{perl expression}. @strong{$_} will contain the
same as @strong{@{@}}. After evaluating @emph{perl expression} @strong{$_} will be used
as the value. It is recommended to only change $_ but you have full
access to all of GNU @strong{parallel}'s internal functions and data
structures.
The @strong{@{=}@emph{perl expression}@strong{=@}} must be given as a single string.
See also: @strong{--rpl} @strong{--parens}
@item @strong{@{=}@emph{n} @emph{perl expression}@strong{=@}}
@anchor{@strong{@{=}@emph{n} @emph{perl expression}@strong{=@}}}
Positional equivalent to @strong{@{= perl expression =@}}. To understand
positional replacement strings see @strong{@{}@emph{n}@strong{@}}.
See also: @strong{@{= perl expression =@}} @strong{@{}@emph{n}@strong{@}}.
@item @strong{:::} @emph{arguments}
@anchor{@strong{:::} @emph{arguments}}
@ -918,8 +942,8 @@ standard specifies @strong{-L} instead.
Implies @strong{-X} unless @strong{-m}, @strong{--xargs}, or @strong{--pipe} is set.
@item @strong{--line-buffer} (beta testing)
@anchor{@strong{--line-buffer} (beta testing)}
@item @strong{--line-buffer}
@anchor{@strong{--line-buffer}}
Buffer output on line basis. @strong{--group} will keep the output together
for a whole job. @strong{--ungroup} allows output to mixup with half a line
@ -1057,8 +1081,8 @@ defaults to '\n'. To have no record separator use @strong{--recend ""}.
See also: @strong{--recstart}, @strong{--recend}, @strong{--fifo}, @strong{--cat}, @strong{--pipepart}.
@item @strong{--pipepart} (alpha testing)
@anchor{@strong{--pipepart} (alpha testing)}
@item @strong{--pipepart} (beta testing)
@anchor{@strong{--pipepart} (beta testing)}
Pipe parts of a physical file. @strong{--pipepart} works similar to
@strong{--pipe}, but is much faster. It has a few limitations:
@ -1184,6 +1208,23 @@ Prompt the user about whether to run each command line and read a line
from the terminal. Only run the command line if the response starts
with 'y' or 'Y'. Implies @strong{-t}.
@item @strong{--parens} @emph{parensstring} (alpha testing)
@anchor{@strong{--parens} @emph{parensstring} (alpha testing)}
Use to define start and end parenthesis for @strong{@{= perl expression =@}}. The
left and the right parenthesis can be multiple characters and are
assumed to be the same length. The default is @strong{@{==@}} giving
@strong{@{=} as the start parenthesis and @strong{=@}} as the end parenthesis.
Another useful setting is @strong{,,,,} which would make both parenthesis
@strong{,,}:
@verbatim
parallel --parens ,,,, echo foo is ,,s/I/O/g,, ::: FII
@end verbatim
See also: @strong{--rpl} @strong{@{= perl expression =@}}
@item @strong{--profile} @emph{profilename}
@anchor{@strong{--profile} @emph{profilename}}
@ -1429,6 +1470,31 @@ time to initialize.
@strong{--keep-order} will not work with @strong{--round-robin} as it is
impossible to track which input block corresponds to which output.
@item @strong{--rpl} '@emph{tag} @emph{perl expression}' (alpha testing)
@anchor{@strong{--rpl} '@emph{tag} @emph{perl expression}' (alpha testing)}
Use @emph{tag} as a replacement string for @emph{perl expression}. This makes
it possible to define your own replacement strings. GNU @strong{parallel}'s
7 replacement strings are implemented as:
@verbatim
--rpl '{} '
--rpl '{#} $_=$job->seq()'
--rpl '{%} $_=$job->slot()'
--rpl '{/} s:.*/::'
--rpl '{//} $Global::use{"File::Basename"} ||= eval "use File::Basename; 1;"; $_ = dirname($_);'
--rpl '{/.} s:.*/::; s:\.[^/.]+$::;'
--rpl '{.} s:\.[^/.]+$::'
@end verbatim
If the user defined replacement string starts with '@{' it can also be
used as a positional replacement string (like @strong{@{2.@}}).
It is recommended to only change $_ but you have full access to all
of GNU @strong{parallel}'s internal functions and data structures.
See also: @strong{@{= perl expression =@}} @strong{--parens}
@item @strong{--max-chars}=@emph{max-chars}
@anchor{@strong{--max-chars}=@emph{max-chars}}
@ -1451,8 +1517,8 @@ operating system and the @strong{-s} option. Pipe the input from /dev/null
(and perhaps specify --no-run-if-empty) if you don't want GNU @strong{parallel}
to do anything.
@item @strong{--semaphore} (beta testing)
@anchor{@strong{--semaphore} (beta testing)}
@item @strong{--semaphore}
@anchor{@strong{--semaphore}}
Work as a counting semaphore. @strong{--semaphore} will cause GNU
@strong{parallel} to start @emph{command} in the background. When the number of
@ -1489,8 +1555,8 @@ Implies @strong{--semaphore}.
See also @strong{man sem}.
@item @strong{--semaphoretimeout} @emph{secs} (beta testing)
@anchor{@strong{--semaphoretimeout} @emph{secs} (beta testing)}
@item @strong{--semaphoretimeout} @emph{secs}
@anchor{@strong{--semaphoretimeout} @emph{secs}}
If the semaphore is not released within secs seconds, take it anyway.
@ -1681,8 +1747,8 @@ The sshloginfile '.' is special, it read sshlogins from
The sshloginfile '-' is special, too, it read sshlogins from stdin
(standard input).
@item @strong{--slotreplace} @emph{replace-str} (beta testing)
@anchor{@strong{--slotreplace} @emph{replace-str} (beta testing)}
@item @strong{--slotreplace} @emph{replace-str}
@anchor{@strong{--slotreplace} @emph{replace-str}}
Use the replacement string @emph{replace-str} instead of @strong{@{%@}} for
job slot number.
@ -2193,6 +2259,15 @@ download images for the past 30 days:
@strong{$(date -d "today -@{1@} days" +%Y%m%d)} will give the dates in
YYYYMMDD with @{1@} days subtracted.
@node EXAMPLE: Digtal clock with "blinking" :
@chapter EXAMPLE: Digtal clock with "blinking" :
The : in a digital clock blinks. To make every other line have a ':'
and the rest a ' ' a perl expression is used to look at the 3rd input
source. If the value modudo 2 is 1: Use ":" otherwise use " ":
@strong{parallel -k echo @{1@}'@{=3 $_=$_%2?":":" "=@}'@{2@}@{3@} ::: @{0..12@} ::: @{0..5@} ::: @{0..9@}}
@node EXAMPLE: Breadth first parallel web crawler/mirrorer
@chapter EXAMPLE: Breadth first parallel web crawler/mirrorer
@ -2997,7 +3072,7 @@ To submit your jobs to the queue:
You can of course use @strong{-S} to distribute the jobs to remote
computers:
@strong{echo }>@strong{jobqueue}; @strong{tail -f jobqueue | parallel -S ..}
@strong{true }>@strong{jobqueue}; @strong{tail -f jobqueue | parallel -S ..}
There is a a small issue when using GNU @strong{parallel} as queue
system/batch manager: You have to submit JobSlot number of jobs before

View file

@ -566,7 +566,7 @@ $Global::Initfile && unlink $Global::Initfile;
exit ($err);
sub parse_options {
$Global::version = 20140622;
$Global::version = 20140711;
$Global::progname = 'sql';
# This must be done first as this may exec myself

Binary file not shown.

View file

@ -3,11 +3,13 @@ testsuite: 3
3: ../src/parallel tests-to-run/* wanted-results/* startdb prereqlocal prereqremote
TRIES=3 time sh Start.sh || true
touch ~/.parallel/will-cite
date
make stopvm
1: ../src/parallel tests-to-run/* wanted-results/* prereqlocal startdb prereqremote
time sh Start.sh || true
touch ~/.parallel/will-cite
date
make stopvm
@ -37,7 +39,7 @@ prereqlocal: installparallel
which timeout || (echo timeout is required for testsuite; /bin/false)
prereqremote: installparallel startvm
parallel ssh parallel@parallel-server{} parallel --minversion 20121021 ::: 1 2 3 || (echo parallel on remote required for testsuite; /bin/true)
parallel --tag ssh parallel@parallel-server{} parallel --minversion 20121021 ::: 1 2 3 || (echo parallel on remote required for testsuite; /bin/true)
startvm:
# Make sure we can reach the virtual machines

View file

@ -4,12 +4,15 @@ rm -rf tmp
mkdir tmp
cd tmp
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | stdout parallel -j6 -k -L1
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | stdout parallel -j5 -k -L1
echo '### bug #41964: --controlmaster not seems to reuse OpenSSH connections to the same host'
(parallel -S redhat9.tange.dk true ::: {1..20}; echo No --controlmaster - finish last) &
(parallel -M -S redhat9.tange.dk true ::: {1..20}; echo With --controlmaster - finish first) &
wait
echo '### Stop if all hosts are filtered and there are no hosts left to run on'
stdout parallel --filter-hosts -S no-such.host echo ::: 1
echo '### bug #41805: Idea: propagate --env for parallel --number-of-cores'
echo '** test_zsh'
FOO=test_zsh parallel --env FOO,PATH -S zsh@lo env ::: "" |sort|egrep 'FOO|PATH'

View file

@ -143,7 +143,7 @@ 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 | uniq
seq 1 1000 | stdout parallel -j1 -s 210 -k --seqreplace I echo IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII \|wc | uniq -c
echo '### 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;

View file

@ -18,3 +18,5 @@ EOF
chmod 755 /tmp/parallel-script-for-script2
echo via pseudotty | script -q -f -c /tmp/parallel-script-for-script2 /dev/null
sleep 2
touch ~/.parallel/will-cite

View file

@ -10,7 +10,7 @@ echo '3 x terminated is OK' >&2
echo '### Test $TMPDIR'
TMPDIR=$SHM stdout timeout -k 1 6 parallel pv -qL10m {} ::: /dev/zero >/dev/null &
PID=$!
seq 1 200 | parallel -j1 "df $SHM | parallel -k --colsep ' +' echo {4}|tail -n 1;sleep 0.1" \
seq 1 200 | parallel -N0 -I // -j1 "df $SHM | parallel -k --colsep ' +' echo {4}|tail -n 1;sleep 0.1" \
| stdout timeout -k 1 10 perl -ne 'BEGIN{$a=<>} $b=<>;
if ($a-1000 > $b) { print "More than 1 MB gone. Good!\n";exit }'
kill $PID
@ -20,7 +20,7 @@ sleep 0.1
echo '### Test --tmpdir'
stdout timeout -k 1 6 parallel --tmpdir $SHM pv -qL10m {} ::: /dev/zero >/dev/null &
PID=$!
seq 1 200 | parallel -j1 "df $SHM | parallel -k --colsep ' +' echo {4}|tail -n 1;sleep 0.1" \
seq 1 200 | parallel -N0 -I // -j1 "df $SHM | parallel -k --colsep ' +' echo {4}|tail -n 1;sleep 0.1" \
| stdout timeout -k 1 10 perl -ne 'BEGIN{$a=<>} $b=<>; if ($a-1000 > $b) { print "More than 1 MB gone. Good!\n"; exit }'
kill $PID
wait
@ -29,7 +29,7 @@ sleep 0.1
echo '### Test $TMPDIR and --tmpdir'
TMPDIR=/tmp stdout timeout -k 1 6 parallel --tmpdir $SHM pv -qL10m {} ::: /dev/zero >/dev/null &
PID=$!
seq 1 200 | parallel -j1 "df $SHM | parallel -k --colsep ' +' echo {4}|tail -n 1;sleep 0.1" \
seq 1 200 | parallel -N0 -I // -j1 "df $SHM | parallel -k --colsep ' +' echo {4}|tail -n 1;sleep 0.1" \
| stdout timeout -k 1 10 perl -ne 'BEGIN{$a=<>} $b=<>; if ($a-1000 > $b) { print "More than 1 MB gone. Good!\n"; exit }'
kill $PID
wait

View file

@ -4,7 +4,7 @@ rsync -Ha --delete input-files/segfault/ tmp/
cd tmp
# -L1 will join lines ending in ' '
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | parallel -j0 -k -L1
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | parallel -j+0 -k -L1
echo '### bug #41565: Print happens in blocks - not after each job complete'
echo 'The timing here is important: 2 3 4 5 6'
ping -c 7 lo | parallel -j3 'echo {#}' | timestamp -dd | perl -pe '$_=int($_+0.2)."\n"'

View file

@ -44,8 +44,8 @@ echo '### nice and tcsh and Bug #33995: Jobs executed with sh instead of $SHELL'
seq 1 2 | SHELL=tcsh MANPATH=. stdout parallel -k --nice 8 setenv a b\;echo \$SHELL
echo '### bug #42041: Implement $PARALLEL_JOBSLOT'
parallel -k --slotreplace ,, -j2 echo ,, ::: {1..4}
parallel -k -j2 echo {%} ::: {1..4}
parallel -k --slotreplace // -j2 sleep 1\;echo // ::: {1..4}
parallel -k -j2 sleep 1\;echo {%} ::: {1..4}
echo '### bug #42363: --pipepart and --fifo/--cat does not work'
seq 100 > /tmp/bug42363;

View file

@ -30,4 +30,15 @@ echo '### How do we deal with missing $HOME'
echo '### How do we deal with missing $SHELL'
unset SHELL; stdout perl -w $(which parallel) -k echo ::: 1 2 3
echo '### Test if length is computed correctly - first should give one line, second 2 lines each'
seq 4 | parallel -s 29 -X -kj1 echo a{}b{}c
seq 4 | parallel -s 28 -X -kj1 echo a{}b{}c
seq 4 | parallel -s 21 -X -kj1 echo {} {}
seq 4 | parallel -s 20 -X -kj1 echo {} {}
seq 4 | parallel -s 23 -m -kj1 echo a{}b{}c
seq 4 | parallel -s 22 -m -kj1 echo a{}b{}c
seq 4 | parallel -s 21 -m -kj1 echo {} {}
seq 4 | parallel -s 20 -m -kj1 echo {} {}
EOF

View file

@ -34,6 +34,11 @@ expect "opt--interactive 3"
_EOF
echo
cat <<'EOF' | parallel -j0 -k -L1
echo '### Test killing children with --timeout and exit value (failed if timed out)'
pstree | grep sleep | grep -v anacron | grep -v screensave | wc;
parallel --timeout 3 'true {} ; for i in `seq 100 120`; do bash -c "(sleep $i)" & sleep $i & done; wait; echo No good' ::: 1000000000 1000000001 ;
echo $?; sleep 7; pstree | grep sleep | grep -v anacron | grep -v screensave | wc
echo '### Test -L -l and --max-lines'
(echo a_b;echo c) | parallel -km -L2 echo
(echo a_b;echo c) | parallel -k -L2 echo
@ -90,10 +95,6 @@ echo '### Test -a and --arg-file: Read input from file instead of stdin'
seq 1 10 >/tmp/$$-1; parallel -k -a /tmp/$$-1 echo
seq 1 10 >/tmp/$$-2; parallel -k --arg-file /tmp/$$-2 echo
echo '### Test killing children with --timeout and exit value (failed if timed out)'
pstree | grep sleep | grep -v anacron | grep -v screensave | wc;
parallel --timeout 3 'true {} ; for i in `seq 100 120`; do bash -c "(sleep $i)" & sleep $i & done; wait; echo No good' ::: 1000000000 1000000001 ;
echo $?; pstree | grep sleep | grep -v anacron | grep -v screensave | wc
EOF
#echo '### Test bugfix if no command given'
@ -264,3 +265,5 @@ seq 19 | parallel -k -N 10 echo a{}b
echo '### Test -L context replace'
seq 19 | parallel -k -L 10 echo a{}b
EOF
touch ~/.parallel/will-cite

View file

@ -8,13 +8,13 @@ SSHLOGIN2=parallel@$SERVER2
# -L1 will join lines ending in ' '
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/\;s/\$SSHLOGIN1/$SSHLOGIN1/\;s/\$SSHLOGIN2/$SSHLOGIN2/ | parallel -j0 -k -L1
echo '### Test --onall';
parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 '(echo {3} {2}) | awk \{print\ \$2}' ::: a b c ::: 1 2
parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 '(echo {1} {2}) | awk \{print\ \$2}' ::: a b c ::: 1 2
echo '### Test | --onall';
seq 3 | parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 '(echo {3} {2}) | awk \{print\ \$2}' ::: a b c :::: -
seq 3 | parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 '(echo {1} {2}) | awk \{print\ \$2}' ::: a b c :::: -
echo '### Test --onall -u';
parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 -u '(echo {3} {2}) | awk \{print\ \$2}' ::: a b c ::: 1 2 3 | sort
parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 -u '(echo {1} {2}) | awk \{print\ \$2}' ::: a b c ::: 1 2 3 | sort
echo '### Test --nonall';
parallel --nonall -k -S $SSHLOGIN1,$SSHLOGIN2 'hostname' | sort

View file

@ -4,4 +4,3 @@
### Test -p
...OK
### Test --sensor -l negative
more than 6 GB used

View file

@ -1,6 +1,9 @@
### bug #41964: --controlmaster not seems to reuse OpenSSH connections to the same host
With --controlmaster - finish first
No --controlmaster - finish last
### Stop if all hosts are filtered and there are no hosts left to run on
parallel: Warning: Removed no-such.host
parallel: Error: There are no hosts left to run on.
### bug #41805: Idea: propagate --env for parallel --number-of-cores
** test_zsh
FOO=test_zsh

View file

@ -83,14 +83,14 @@ foo ole
foo ole
### Test of --colsep
a b c
a b c {4}
a b c
a b c d
a b c
d e f
a b c
d e f
a b c
a b c {4}
a b c
a b c d
### Test of tab as colsep
abc def
@ -106,25 +106,25 @@ jkl mno pqr
### Test of quoting after colsplit
>/tmp/null >/dev/null
### Test of --colsep as regexp
a b c {4}
a b c
a b c d
a b c {4}
a b c
a b c d
a b c {4}
a b c
a b c d
a_b_c_{4}
a_b_c_
a_b_c_d
### Test of -C
a_b_c_{4}
a_b_c_
a_b_c_d
### Test of --trim n
a_b_\ c\ _{4}
a_b_\ c\ _
a_\ b\ _c_d
a_b_c_{4}
a_b_c_
a_b_c_d
### Test of bug: If input is empty string
echo {2}
{2}
echo
echo ac
ac
echo ac
@ -257,8 +257,9 @@ o
9
10
### Test --seqreplace and line too long
1 1 130001
parallel: Error: Command line too long (260009 >= 131071) at number 9: 10...
9 1 1 101
90 1 1 201
1 parallel: Error: Command line too long (309 >= 210) at number 0: 100...
### bug #37042: -J foo is taken from the whole command line - not just the part before the command
foo tag_with_foo
a tag_with_a

View file

@ -71,7 +71,7 @@ y
### -i -s26 -0 echo from \{\} to x{}y < items-0.xi
xargs: argument list too long
from one to xoney
parallel: Error: Command line too long (42 >= 26) at number 2:
parallel: Error: Command line too long (42 >= 26) at number 0:
...
### -l -0 echo < ldata-0.xi
1 22 333 4444
@ -829,7 +829,7 @@ with 'single quotes' as well.
/src/gnu/autoconf-1.11/texinfo.tex
### -s6 echo < files.xi
xargs: argument line too long
parallel: Error: Command line too long (27 >= 6) at number 7: /src/gnu/autoconf-1.11...
parallel: Error: Command line too long (27 >= 6) at number -7: /src/gnu/autoconf-1.11...
### -iARG -s86 echo ARG is xARGx < files.xi
/src/gnu/autoconf-1.11 is x/src/gnu/autoconf-1.11x
/src/gnu/autoconf-1.11/README is x/src/gnu/autoconf-1.11/READMEx
@ -995,7 +995,7 @@ from: can't read /var/mail/{}
### -i -s26 echo from \{\} to x{}y < items.xi
xargs: argument list too long
from dumb to xdumby
parallel: Error: Command line too long (36 >= 26) at number 1: ...
parallel: Error: Command line too long (36 >= 26) at number 0: ...
### -i__ echo FIRST __ IS OK < quotes.xi
FIRST this is IS OK
FIRST quoted stuff IS OK

View file

@ -45,9 +45,9 @@ bug #37694: Empty string argument skipped when using --quote
11 1
12 2
11 3
a_b_c_{4}
a_b_c_
a_b_c_d
{4}
### test08
b
d

View file

@ -112,3 +112,25 @@ parallel: Warning: $SHELL not set. Using /bin/sh.
1
2
3
echo '### Test if length is computed correctly - first should give one line, second 2 lines each'
### Test if length is computed correctly - first should give one line, second 2 lines each
seq 4 | parallel -s 29 -X -kj1 echo a{}b{}c
a1b1c a2b2c a3b3c a4b4c
seq 4 | parallel -s 28 -X -kj1 echo a{}b{}c
a1b1c a2b2c a3b3c
a4b4c
seq 4 | parallel -s 21 -X -kj1 echo {} {}
1 2 3 4 1 2 3 4
seq 4 | parallel -s 20 -X -kj1 echo {} {}
1 2 3 1 2 3
4 4
seq 4 | parallel -s 23 -m -kj1 echo a{}b{}c
a1 2 3 4b1 2 3 4c
seq 4 | parallel -s 22 -m -kj1 echo a{}b{}c
a1 2 3b1 2 3c
a4b4c
seq 4 | parallel -s 21 -m -kj1 echo {} {}
1 2 3 4 1 2 3 4
seq 4 | parallel -s 20 -m -kj1 echo {} {}
1 2 3 1 2 3
4 4

View file

@ -330,7 +330,7 @@ echo 999999999
### Test eof string after :::
foo
### Test -C and --trim rl
a_b_c_{4}
a_b_c_
a_b_c_d
### Test empty input
### Test -m

View file

@ -2,7 +2,6 @@
Setup on polarhome machines
copy_and_test minix.polarhome.com
minix.polarhome.com ### Run the test on minix.polarhome.com
minix.polarhome.com Works on minix.polarhome.com
copy_and_test freebsd.polarhome.com
freebsd.polarhome.com ### Run the test on freebsd.polarhome.com
freebsd.polarhome.com Works on freebsd.polarhome.com

View file

@ -29,6 +29,10 @@ sleep 0.1; echo opt--interactive 3 ?...y
opt--interactive 1
opt--interactive 3
### Test killing children with --timeout and exit value (failed if timed out)
0 0 0
2
0 0 0
### Test -L -l and --max-lines
a_b
c
@ -101,14 +105,14 @@ a_b c
d
e
### test too long args
parallel: Error: Command line too long (1000005 >= 131071) at number 1: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
parallel: Error: Command line too long (1000005 >= 131071) at number 0: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
xargs: argument line too long
1 2
3 4
5 6
7 8
9 10
parallel: Error: Command line too long (1000007 >= 10) at number 5: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
parallel: Error: Command line too long (1000007 >= 10) at number 0: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
1 2
3 4
5 6
@ -120,20 +124,20 @@ xargs: argument line too long
5 6
7 8
9 10
parallel: Error: Command line too long (1000007 >= 10) at number 5: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
parallel: Error: Command line too long (1000007 >= 10) at number 0: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
### Test -x
1 2
3 4
5 6
7 8
9 10
parallel: Error: Command line too long (10 >= 10) at number 5: 12345...
parallel: Error: Command line too long (10 >= 10) at number 0: 12345...
1 2
3 4
5 6
7 8
9 10
parallel: Error: Command line too long (10 >= 10) at number 5: 12345...
parallel: Error: Command line too long (10 >= 10) at number 0: 12345...
1 2
3 4
5 6
@ -190,10 +194,6 @@ xargs: argument line too long
8
9
10
### Test killing children with --timeout and exit value (failed if timed out)
0 0 0
2
0 0 0
xargs Expect: 3 1 2
3
1

View file

@ -13,10 +13,10 @@ echo 1 2 3 4 5 6 7 8 9 10 ; echo 1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
### Test of -X {1}-{2} with multiple input sources
a-b
a-c a-d
b-c b-d
a-d a-e a-f b-d b-e
b-f c-d c-e c-f
a-c
b-c
a-d
b-f
a-d
a-e
a-f