parallel: Fixed to pass local testsuite and some Perl::Critic issues.

This commit is contained in:
Ole Tange 2012-10-17 02:09:03 +02:00
parent c60cc12b24
commit fcaf41b325
13 changed files with 201 additions and 96 deletions

View file

@ -10,8 +10,6 @@ Luk filen ved EOF - lad være med bare at læse videre.
> /tmp/ged; tail -f /tmp/ged| parallel -n1 -E eof & sleep 1; echo echo a >>/tmp/ged; echo eof >>/tmp/ged; seq 4 >>/tmp/ged; wait > /tmp/ged; tail -f /tmp/ged| parallel -n1 -E eof & sleep 1; echo echo a >>/tmp/ged; echo eof >>/tmp/ged; seq 4 >>/tmp/ged; wait
Fhqwhgads som 20120122 pga 10 års jubliæum.
--timeout auto: If a jobs takes > 3*moving average runtime then kill it. Only after job 3. --timeout auto: If a jobs takes > 3*moving average runtime then kill it. Only after job 3.
niceload seeks last column: niceload seeks last column:
@ -31,9 +29,6 @@ cat <<'_EOF' | parallel -v echo
awk -v FS="\",\"" '{print $1, $3, $4, $5, $9, $14}' | grep -v "#" | sed -e '1d' -e 's/\"//g' -e 's/\/\/\//\t/g' | cut -f1-6,11 | sed -e 's/\/\//\t/g' -e 's/ /\t/g awk -v FS="\",\"" '{print $1, $3, $4, $5, $9, $14}' | grep -v "#" | sed -e '1d' -e 's/\"//g' -e 's/\/\/\//\t/g' | cut -f1-6,11 | sed -e 's/\/\//\t/g' -e 's/ /\t/g
_EOF _EOF
\'-tricket
ls *bed | parallel -j 10 intersectBed -a good-genes.gff -b {} -c \| awk \''BEGIN{OFS="\t\";} {print $1,$9,$4,$5,$7,$10}'\' > test.txt
FN="two spaces" FN="two spaces"
echo 1 | parallel -q echo {} "$FN" echo 1 | parallel -q echo {} "$FN"
# Prints 2 spaces between 'two' and 'spaces' # Prints 2 spaces between 'two' and 'spaces'

View file

@ -171,19 +171,28 @@ cc:Sandro Cazzaniga <kharec@mandriva.org>,
Ryoichiro Suzuki <ryoichiro.suzuki@gmail.com>, Ryoichiro Suzuki <ryoichiro.suzuki@gmail.com>,
Jesse Alama <jesse.alama@gmail.com> Jesse Alama <jesse.alama@gmail.com>
Subject: GNU Parallel 20120922 ('X') released Subject: GNU Parallel 20121022 ('Hanne Vilmann') released
GNU Parallel 20120922 ('X') has been released. It is GNU Parallel 20121022 ('Hanne Vilmann') has been released. It is
available for download at: http://ftp.gnu.org/gnu/parallel/ available for download at: http://ftp.gnu.org/gnu/parallel/
New in this release: New in this release:
* When using GNU Parallel for simulations --results makes it easy to
select output from some arguments.
* Use --env to transfer environment variables through ssh to remote
machines.
* GNU Parallel is accepted for Ubuntu Quantal. * GNU Parallel is accepted for Ubuntu Quantal.
http://packages.ubuntu.com/quantal/parallel http://packages.ubuntu.com/quantal/parallel
* GNU Parallel was requested for OpenSUSE (go vote!) * GNU Parallel was requested for OpenSUSE (go vote!)
https://features.opensuse.org/314461 https://features.opensuse.org/314461
* Kneth's Korner: Map/Reduce and GNU Parallel
http://kenneth.geisshirt.dk/2012/10/mapreduce-and-gnu-parallel.html
* Blog post in Japanese by Siguniang. * Blog post in Japanese by Siguniang.
https://siguniang.wordpress.com/2012/09/09/notes-on-gnu-parallel-the-command-line-power-tool/ https://siguniang.wordpress.com/2012/09/09/notes-on-gnu-parallel-the-command-line-power-tool/
(Siguniang mentions the logo is called 'The Cafe Wall Illusion') (Siguniang mentions the logo is called 'The Cafe Wall Illusion')

View file

@ -208,6 +208,7 @@ if($::opt_nonall or $::opt_onall) {
((defined $::opt_D) ? "-D" : ""), ((defined $::opt_D) ? "-D" : ""),
((defined $::opt_timeout) ? "--timeout ".$::opt_timeout : ""), ((defined $::opt_timeout) ? "--timeout ".$::opt_timeout : ""),
((defined $::opt_plain) ? "--plain" : ""), ((defined $::opt_plain) ? "--plain" : ""),
((defined @::opt_env) ? map { "--env ".::shell_quote_scalar($_) } @::opt_env : ""),
); );
::debug("| $0 $options\n"); ::debug("| $0 $options\n");
open(my $parallel_fh, "|-", "$0 -j0 $options") || open(my $parallel_fh, "|-", "$0 -j0 $options") ||
@ -605,7 +606,7 @@ sub get_options_from_array {
sub parse_options { sub parse_options {
# Returns: N/A # Returns: N/A
# Defaults: # Defaults:
$Global::version = 20120930; $Global::version = 20121015;
$Global::progname = 'parallel'; $Global::progname = 'parallel';
$Global::infinity = 2**31; $Global::infinity = 2**31;
$Global::debug = 0; $Global::debug = 0;
@ -837,6 +838,13 @@ sub parse_options {
open_joblog(); open_joblog();
} }
sub env_quote {
my $v = shift;
$v =~ s/([\\])/\\$1/g;
$v =~ s/([\[\] \#\'\n\&\<\>\(\)\;\{\}\t\"\$\`\*\174\!\?\~])/\\$1/g;
return $v;
}
sub parse_env_var { sub parse_env_var {
# Parse --env and set $Global::envvar # Parse --env and set $Global::envvar
# Returns: N/A # Returns: N/A
@ -846,15 +854,22 @@ sub parse_env_var {
# Split up --env VAR1,VAR2 # Split up --env VAR1,VAR2
push @vars, split /,/, $varstring; push @vars, split /,/, $varstring;
} }
$Global::envvar = # Keep only defined variables
(q{eval `echo $SHELL | grep -E "/(t)?csh" > /dev/null} @vars = grep { defined($ENV{$_}) } @vars;
. q{ && echo } my @qcsh = map { my $a=$_; "setenv $a " . env_quote($ENV{$a}) } @vars;
. join("", map { "setenv $_ " my @qbash = map { my $a=$_; "export $a=" . env_quote($ENV{$a}) } @vars;
. ::shell_quote_scalar(::shell_quote_scalar($ENV{$_})).'\;' } @vars)
. q{ || echo } # Create lines like:
. join("", map { "export $_=" # echo $SHELL | grep -E "/t?csh" >/dev/null && setenv V1 val1 && setenv V2 val2 || export V1=val1 && export V2=val2 ; echo "$V1$V2"
. ::shell_quote_scalar(::shell_quote_scalar($ENV{$_})).'\;' } @vars) if(@vars) {
.q{`;}); $Global::envvar =
join"",
(q{echo $SHELL | grep -E "/t?csh" > /dev/null && }
. join(" && ", @qcsh)
. q{ || }
. join(" && ", @qbash)
.q{;});
}
$Global::envvarlen = length $Global::envvar; $Global::envvarlen = length $Global::envvar;
} }
@ -1041,7 +1056,7 @@ sub __QUOTING_ARGUMENTS_FOR_SHELL__ {}
sub shell_quote { sub shell_quote {
my @strings = (@_); my @strings = (@_);
for my $a (@strings) { for my $a (@strings) {
$a =~ s/([\002-\011\013-\032\\\#\?\`\(\)\{\}\[\]\*\>\<\~\|\; \"\!\$\&\'])/\\$1/g; $a =~ s/([\002-\011\013-\032\\\#\?\`\(\)\{\}\[\]\*\>\<\~\|\; \"\!\$\&\'\202-\377])/\\$1/g;
$a =~ s/[\n]/'\n'/g; # filenames with '\n' is quoted using \' $a =~ s/[\n]/'\n'/g; # filenames with '\n' is quoted using \'
} }
return wantarray ? @strings : "@strings"; return wantarray ? @strings : "@strings";
@ -1052,8 +1067,10 @@ sub shell_quote_scalar {
# Returns: # Returns:
# string quoted with \ as needed by the shell # string quoted with \ as needed by the shell
my $a = shift; my $a = shift;
$a =~ s/([\002-\011\013-\032\\\#\?\`\(\)\{\}\[\]\*\>\<\~\|\; \"\!\$\&\'])/\\$1/g; if(defined $a) {
$a =~ s/[\n]/'\n'/g; # filenames with '\n' is quoted using \' $a =~ s/([\002-\011\013-\032\\\#\?\`\(\)\{\}\[\]\*\>\<\~\|\; \"\!\$\&\'\202-\377])/\\$1/g;
$a =~ s/[\n]/'\n'/g; # filenames with '\n' is quoted using \'
}
return $a; return $a;
} }
@ -3216,13 +3233,13 @@ sub openresultsfile {
my $self = shift; my $self = shift;
my $args_as_filename = $self->{'commandline'}->args_as_filename(); my $args_as_filename = $self->{'commandline'}->args_as_filename();
my ($outfh,$errfh,$name); my ($outfh,$errfh,$name);
$name = $::opt_results."stdout_".$args_as_filename; $name = $::opt_results."stdout\t".$args_as_filename;
if(not open($outfh,"+>",$name)) { if(not open($outfh,"+>",$name)) {
::error("Cannot write to `$name'.\n"); ::error("Cannot write to `$name'.\n");
::wait_and_exit(255); ::wait_and_exit(255);
} }
$self->set_stdoutfilename($name); $self->set_stdoutfilename($name);
$name = $::opt_results."stderr_".$args_as_filename; $name = $::opt_results."stderr\t".$args_as_filename;
if(not open($errfh,"+>",$name)) { if(not open($errfh,"+>",$name)) {
::error("Cannot write to `$name'.\n"); ::error("Cannot write to `$name'.\n");
::wait_and_exit(255); ::wait_and_exit(255);
@ -4295,7 +4312,7 @@ sub multi_regexp {
if(not $CommandLine::multi_regexp) { if(not $CommandLine::multi_regexp) {
$CommandLine::multi_regexp = $CommandLine::multi_regexp =
"(?:". "(?:".
join("|",map {my ($a = $_) =~ s/(\W)/\\$1/g; $a } join("|",map {my $a=$_; $a =~ s/(\W)/\\$1/g; $a}
($Global::replace{"{}"}, ($Global::replace{"{}"},
$Global::replace{"{.}"}, $Global::replace{"{.}"},
$Global::replace{"{/}"}, $Global::replace{"{/}"},
@ -4321,7 +4338,7 @@ sub number_of_replacements {
'\d+(?:|\.|/\.|/|//)?' . # {n} {n.} {n/.} {n/} {n//} '\d+(?:|\.|/\.|/|//)?' . # {n} {n.} {n/.} {n/} {n//}
::maybe_quote('\}') . ::maybe_quote('\}') .
'|'. '|'.
join("|",map { my ($a = $_) =~ s/(\W)/\\$1/g; $a } values %Global::replace). join("|",map {$a=$_;$a=~s/(\W)/\\$1/g; $a} values %Global::replace).
")"; ")";
my %c = (); my %c = ();
$cmd =~ s/($replacement_regexp)/$c{$1}++;"\0"/ogex; $cmd =~ s/($replacement_regexp)/$c{$1}++;"\0"/ogex;
@ -4370,7 +4387,7 @@ sub replaced {
# Is this really a command in $PATH starting with '-'? # Is this really a command in $PATH starting with '-'?
my $cmd = $1; my $cmd = $1;
if(not grep { -e $_."/".$cmd } split(":",$ENV{'PATH'})) { if(not grep { -e $_."/".$cmd } split(":",$ENV{'PATH'})) {
::error("Command ($cmd) starts with '-'. Is this a wrong option?.\n"); ::error("Command ($cmd) starts with '-'. Is this a wrong option?\n");
::wait_and_exit(255); ::wait_and_exit(255);
} }
} }
@ -4450,9 +4467,9 @@ sub context_replace_placeholders {
# Inner part of replacement functions # Inner part of replacement functions
my @rep_inner = ('', '/', '//', '.', '/.'); my @rep_inner = ('', '/', '//', '.', '/.');
# Regexp for replacement functions # Regexp for replacement functions
my $rep_regexp = "(?:". join('|', map { my ($s = $_) =~ s/(\W)/\\$1/g; $s } @rep) . ")"; my $rep_regexp = "(?:". join('|', map { my $s = $_; $s =~ s/(\W)/\\$1/g; $s } @rep) . ")";
# Regexp for inner replacement functions # Regexp for inner replacement functions
my $rep_inner_regexp = "(?:". join('|', map { my ($s = $_) =~ s/(\W)/\\$1/g; $s } @rep_inner) . ")"; my $rep_inner_regexp = "(?:". join('|', map { my $s = $_; $s =~ s/(\W)/\\$1/g; $s } @rep_inner) . ")";
# Seq replace string: {#} # Seq replace string: {#}
my $rep_seq_regexp = '(?:'.::maybe_quote('\{\#\}').")"; my $rep_seq_regexp = '(?:'.::maybe_quote('\{\#\}').")";
# Normal replace strings # Normal replace strings
@ -4526,7 +4543,7 @@ sub context_replace_placeholders {
} }
# Substitute the replace strings with the replacement values # Substitute the replace strings with the replacement values
# Must be sorted by length if a short word is a substring of a long word # Must be sorted by length if a short word is a substring of a long word
my $regexp = join('|', map { my ($s = $_) =~ s/(\W)/\\$1/g; $s } my $regexp = join('|', map { my $s = $_; $s =~ s/(\W)/\\$1/g; $s }
sort { length $b <=> length $a } keys %word); sort { length $b <=> length $a } keys %word);
$target =~ s/($regexp)/join(" ",@{$replace{$1}})/ge; $target =~ s/($regexp)/join(" ",@{$replace{$1}})/ge;
return $target; return $target;
@ -4580,7 +4597,7 @@ sub simple_replace_placeholders {
} }
} }
# Substitute the replace strings with the replacement values # Substitute the replace strings with the replacement values
my $regexp = join('|', map { my ($s = $_) =~ s/(\W)/\\$1/g; $s } keys %replace); my $regexp = join('|', map { my $s = $_; $s =~ s/(\W)/\\$1/g; $s } keys %replace);
if($regexp) { if($regexp) {
if($quoteall) { if($quoteall) {
# This is for --return: The whole expression must be # This is for --return: The whole expression must be

View file

@ -992,7 +992,7 @@ E.g:
parallel --header : --results foo/bar echo {a} {b} ::: a I II ::: b III IIII parallel --header : --results foo/bar echo {a} {b} ::: a I II ::: b III IIII
will generate: will generate the files:
foo/barstderr_a I b III foo/barstderr_a I b III
foo/barstderr_a I b IIII foo/barstderr_a I b IIII
@ -1007,7 +1007,7 @@ and
parallel --results foo/bar echo {1} {2} ::: 1 2 ::: 3 4 parallel --results foo/bar echo {1} {2} ::: 1 2 ::: 3 4
will generate: will generate the files:
foo/barstderr_1 I 2 III foo/barstderr_1 I 2 III
foo/barstderr_1 I 2 IIII foo/barstderr_1 I 2 IIII
@ -1857,14 +1857,14 @@ big overhead if the job takes very few ms to run. Often you can group
small jobs together using B<-X> which will make the overhead less small jobs together using B<-X> which will make the overhead less
significant. Compare the speed of these: significant. Compare the speed of these:
B<seq -w 0 9999 | parallel touch pict{}.jpg> seq -w 0 9999 | parallel touch pict{}.jpg
B<seq -w 0 9999 | parallel -X touch pict{}.jpg> seq -w 0 9999 | parallel -X touch pict{}.jpg
If your program cannot take multiple arguments, then you can use GNU If your program cannot take multiple arguments, then you can use GNU
B<parallel> to spawn multiple GNU B<parallel>s: B<parallel> to spawn multiple GNU B<parallel>s:
B<seq -w 0 999999 | parallel -j10 --pipe parallel -j0 touch pict{}.jpg> seq -w 0 999999 | parallel -j10 --pipe parallel -j0 touch pict{}.jpg
If B<-j0> normally spawns 506 jobs, then the above will try to spawn If B<-j0> normally spawns 506 jobs, then the above will try to spawn
5060 jobs. It is likely that you this way will hit the limit of number 5060 jobs. It is likely that you this way will hit the limit of number
@ -2413,18 +2413,18 @@ characters that have special meaning in shell:
and depending on context these needs to be quoted, too: and depending on context these needs to be quoted, too:
* ~ & # ! ? space * { ~ & # ! ? space * {
Therefore most people will never need more quoting than putting '\' Therefore most people will never need more quoting than putting '\'
in front of the special characters. in front of the special characters.
Often you can simply put \' around every ': Often you can simply put \' around every ':
B<perl -ne '/^\S+\s+\S+$/ and print $ARGV,"\n"' file> perl -ne '/^\S+\s+\S+$/ and print $ARGV,"\n"' file
can be quoted: can be quoted:
B<parallel perl -ne \''/^\S+\s+\S+$/ and print $ARGV,"\n"'\' ::: file> parallel perl -ne \''/^\S+\s+\S+$/ and print $ARGV,"\n"'\' ::: file
However, when you want to use a shell variable you need to quote the However, when you want to use a shell variable you need to quote the
$-sign. Here is an example using $PARALLEL_SEQ. This variable is set $-sign. Here is an example using $PARALLEL_SEQ. This variable is set

View file

@ -8,5 +8,4 @@ echo '### See if we get compile error'
PATH=input-files/perllib:../input-files/perllib:$PATH PATH=input-files/perllib:../input-files/perllib:$PATH
perl32 `which parallel` ::: 'echo perl' perl32 `which parallel` ::: 'echo perl'
echo '### See if we read modules outside perllib' echo '### See if we read modules outside perllib'
echo perl | stdout strace -ff parallel echo | grep open | grep perl | grep -v input-files/perllib echo perl | stdout strace -ff perl32 `which parallel` echo | grep open | grep perl | grep -v input-files/perllib

View file

@ -6,15 +6,49 @@ seq 1 3 | parallel -j1 "sleep 2; echo {}" | parallel -kj2 echo
echo '### Test --env - https://savannah.gnu.org/bugs/?37351' echo '### Test --env - https://savannah.gnu.org/bugs/?37351'
export TWOSPACES=' 2 spaces ' export TWOSPACES=' 2 spaces '
export THREESPACES=" > My brother's 12\" records < " export THREESPACES=" > My brother's 12\" records < "
echo a"$TWOSPACES"b 1
parallel --env TWOSPACES echo 'a"$TWOSPACES"b' ::: 1 parallel --env TWOSPACES echo 'a"$TWOSPACES"b' ::: 1
parallel --env TWOSPACES --env THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 2
parallel --env TWOSPACES,THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 2a
parallel -S localhost --env TWOSPACES echo 'a"$TWOSPACES"b' ::: 1 parallel -S localhost --env TWOSPACES echo 'a"$TWOSPACES"b' ::: 1
parallel -S localhost --env TWOSPACES --env THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 2
parallel -S localhost --env TWOSPACES,THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 2a
parallel -S csh@localhost --env TWOSPACES echo 'a"$TWOSPACES"b' ::: 1 parallel -S csh@localhost --env TWOSPACES echo 'a"$TWOSPACES"b' ::: 1
parallel -S tcsh@localhost --env TWOSPACES echo 'a"$TWOSPACES"b' ::: 1
echo a"$TWOSPACES"b a"$THREESPACES"b 2
parallel --env TWOSPACES --env THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 2
parallel -S localhost --env TWOSPACES --env THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 2
parallel -S csh@localhost --env TWOSPACES --env THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 2 parallel -S csh@localhost --env TWOSPACES --env THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 2
parallel -S csh@localhost --env TWOSPACES,THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 2a parallel -S tcsh@localhost --env TWOSPACES --env THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 2
echo a"$TWOSPACES"b a"$THREESPACES"b 3
parallel --env TWOSPACES,THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 3
parallel -S localhost --env TWOSPACES,THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 3
parallel -S csh@localhost --env TWOSPACES,THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 3
parallel -S tcsh@localhost --env TWOSPACES,THREESPACES echo 'a"$TWOSPACES"b' 'a"$THREESPACES"b' ::: 3
export MIN=" \'\""
echo a"$MIN"b 4
parallel --env MIN echo 'a"$MIN"b' ::: 4
parallel -S localhost --env MIN echo 'a"$MIN"b' ::: 4
parallel -S csh@localhost --env MIN echo 'a"$MIN"b' ::: 4
parallel -S tcsh@localhost --env MIN echo 'a"$MIN"b' ::: 4
export SPC="'"' * ? >o <i*? ][\!#¤%=( ) | }'
echo a"$SPC"b 5
parallel --env SPC echo 'a"$SPC"b' ::: 5
parallel -S localhost --env SPC echo 'a"$SPC"b' ::: 5
parallel -S csh@localhost --env SPC echo 'a"$SPC"b' ::: 5
parallel -S tcsh@localhost --env SPC echo 'a"$SPC"b' ::: 5
echo '### Test --env for \n and \\ - single and double - no output is good'
perl -e 'for(10,92) { printf "%c%c %c%d\0",$_,$_,$_,$_ }' | stdout parallel --nice 19 -j4 -k -I // --arg-sep _ -0 V=// V2=V2=// parallel -k -j1 -S :,1/lo,1/tcsh@lo,1/csh@lo --env V,V2 echo \''"{}$V$V2"'\' ::: {#} {#} {#} {#} | uniq -c | grep -v ' 4 '|grep -v xauth |grep -v X11
echo '### Test --env for \n and \\ - single and double --onall - no output is good'
perl -e 'for(10,92) { printf "%c%c %c%d\0",$_,$_,$_,$_ }' | stdout parallel --nice 19 -j4 -k -I // --arg-sep _ -0 V=// V2=V2=// parallel -k -j1 -S :,1/lo,1/tcsh@lo,1/csh@lo --onall --env V,V2 echo \''"{}$V$V2"'\' ::: {#} | uniq -c | grep -v ' 4 '|grep -v xauth |grep -v X11
echo '### Test --env for \160 - which kills csh - single and double - no output is good'
perl -e 'for(160) { printf "%c%c %c%d\0",$_,$_,$_,$_ }' | stdout parallel --nice 19 -j4 -k -I // --arg-sep _ -0 V=// V2=V2=// parallel -k -j1 -S :,1/lo,1/tcsh@lo --env V,V2 echo \''"{}$V$V2"'\' ::: {#} {#} {#} | uniq -c | grep -v ' 3 '|grep -v xauth |grep -v X11
echo '### Test --env for \160 - which kills csh - single and double --onall - no output is good'
perl -e 'for(160) { printf "%c%c %c%d\0",$_,$_,$_,$_ }' | stdout parallel --nice 19 -j4 -k -I // --arg-sep _ -0 V=// V2=V2=// parallel -k -j1 -S :,1/lo,1/tcsh@lo --onall --env V,V2 echo \''"{}$V$V2"'\' ::: {#} | uniq -c | grep -v ' 3 '|grep -v xauth |grep -v X11
echo '### Test too slow spawning' echo '### Test too slow spawning'
killall -9 burnP6 2>/dev/null killall -9 burnP6 2>/dev/null

View file

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
echo '### Test --joblog with exitval and Test --joblog with signal' echo '### Test --joblog with exitval and Test --joblog with signal'
parallel --joblog /tmp/parallel_joblog_exitval 'sleep {} && echo foo' ::: 100 2>/dev/null & parallel --joblog /tmp/parallel_joblog_exitval 'sleep {} && echo sleep was not killed=BAD' ::: 100 2>/dev/null &
parallel --joblog /tmp/parallel_joblog_signal 'sleep {}' ::: 100 2>/dev/null & parallel --joblog /tmp/parallel_joblog_signal 'sleep {}' ::: 100 2>/dev/null &
sleep 0.5 sleep 1
killall -6 sleep killall -6 sleep
sleep 0.1 sleep 0.1
grep -q 134 /tmp/parallel_joblog_exitval && echo exitval OK grep -q 134 /tmp/parallel_joblog_exitval && echo exitval OK
@ -11,3 +11,10 @@ grep -q '[^0-9]6[^0-9]' /tmp/parallel_joblog_signal && echo signal OK
rm /tmp/parallel_joblog_exitval /tmp/parallel_joblog_signal rm /tmp/parallel_joblog_exitval /tmp/parallel_joblog_signal
echo '### Test --env all chars except \n,\92,\160 - single and double - no output is good'
# 92 and 160 are special for csh
perl -e 'for(1..9,9,11..91,91,93..159,159,161..255) { printf "%c%c %c%d\0",$_,$_,$_,$_ }' | stdout parallel --nice 19 -j4 -k -I // --arg-sep _ -0 V=// V2=V2=// parallel -k -j1 -S :,1/lo,1/tcsh@lo,1/csh@lo --env V,V2 echo \''"{}$V$V2"'\' ::: {#} {#} {#} {#} | uniq -c | grep -v ' 4 '|grep -v xauth |grep -v X11
echo '### Test --env all chars except \n,\92,\160 - single and double --onall - no output is good'
# 92 and 160 are special for csh
perl -e 'for(1..9,9,11..91,91,93..159,159,161..255) { printf "%c%c %c%d\0",$_,$_,$_,$_ }' | stdout parallel --nice 19 -j4 -k -I // --arg-sep _ -0 V=// V2=V2=// parallel -k -j1 -S :,1/lo,1/tcsh@lo,1/csh@lo --onall --env V,V2 echo \''"{}$V$V2"'\' ::: {#} | uniq -c | grep -v ' 4 '|grep -v xauth |grep -v X11

View file

@ -1,8 +1,8 @@
dcf2c2d2262ebbd3a97bb5e1d759cd38 - 33802d2d7671966df3c40ddd35c56c67 -
There are 6246 dirs with 6246 files There are 6246 dirs with 6246 files
Removing files Removing files
b001b66cebd62b43bf78f1ab282495c9 - e364fd590106adc42f4d052d1cd64b37 -
There are 6246 dirs with files There are 6246 dirs with files
Removing dirs Removing dirs
b88970f52ad2ae3d922bc44c3ed99657 - 404a3f0c1ca9a1f0024ae97b3d24a878 -
There are 1 dirs with files There are 1 dirs with files

View file

@ -77,10 +77,10 @@ a8 b1 2 3 4 5 6 7 8
a9 b1 2 3 4 5 6 7 8 9 a9 b1 2 3 4 5 6 7 8 9
a10 b1 2 3 4 5 6 7 8 9 10 a10 b1 2 3 4 5 6 7 8 9 10
### Test max line length -m -I ### Test max line length -m -I
623249e8b509099d71745dbddc3fe5ce - 31d9274be5fdc2de59487cb05ba57776 -
Chars per line (697800/6): 116300 Chars per line (697800/6): 116300
### Test max line length -X -I ### Test max line length -X -I
ae59907d4a33798608843da7ffcb29ed - 22074f9acada52462defb18ba912d744 -
Chars per line (817788/7): 116826 Chars per line (817788/7): 116826
### bug #36659: --sshlogin strips leading slash from ssh command ### bug #36659: --sshlogin strips leading slash from ssh command
OK OK
@ -121,66 +121,66 @@ I III
I IIII I IIII
II III II III
II IIII II IIII
/tmp/parallel_results_test/testAstderr_1 I 2 III /tmp/parallel_results_test/testAstderr 1 I 2 III
/tmp/parallel_results_test/testAstderr_1 I 2 IIII /tmp/parallel_results_test/testAstderr 1 I 2 IIII
/tmp/parallel_results_test/testAstderr_1 II 2 III /tmp/parallel_results_test/testAstderr 1 II 2 III
/tmp/parallel_results_test/testAstderr_1 II 2 IIII /tmp/parallel_results_test/testAstderr 1 II 2 IIII
/tmp/parallel_results_test/testAstdout_1 I 2 III /tmp/parallel_results_test/testAstdout 1 I 2 III
/tmp/parallel_results_test/testAstdout_1 I 2 IIII /tmp/parallel_results_test/testAstdout 1 I 2 IIII
/tmp/parallel_results_test/testAstdout_1 II 2 III /tmp/parallel_results_test/testAstdout 1 II 2 III
/tmp/parallel_results_test/testAstdout_1 II 2 IIII /tmp/parallel_results_test/testAstdout 1 II 2 IIII
### Test --res ### Test --res
I III I III
I IIII I IIII
II III II III
II IIII II IIII
/tmp/parallel_results_test/testDstderr_1 I 2 III /tmp/parallel_results_test/testDstderr 1 I 2 III
/tmp/parallel_results_test/testDstderr_1 I 2 IIII /tmp/parallel_results_test/testDstderr 1 I 2 IIII
/tmp/parallel_results_test/testDstderr_1 II 2 III /tmp/parallel_results_test/testDstderr 1 II 2 III
/tmp/parallel_results_test/testDstderr_1 II 2 IIII /tmp/parallel_results_test/testDstderr 1 II 2 IIII
/tmp/parallel_results_test/testDstdout_1 I 2 III /tmp/parallel_results_test/testDstdout 1 I 2 III
/tmp/parallel_results_test/testDstdout_1 I 2 IIII /tmp/parallel_results_test/testDstdout 1 I 2 IIII
/tmp/parallel_results_test/testDstdout_1 II 2 III /tmp/parallel_results_test/testDstdout 1 II 2 III
/tmp/parallel_results_test/testDstdout_1 II 2 IIII /tmp/parallel_results_test/testDstdout 1 II 2 IIII
### Test --result ### Test --result
I III I III
I IIII I IIII
II III II III
II IIII II IIII
/tmp/parallel_results_test/testEstderr_1 I 2 III /tmp/parallel_results_test/testEstderr 1 I 2 III
/tmp/parallel_results_test/testEstderr_1 I 2 IIII /tmp/parallel_results_test/testEstderr 1 I 2 IIII
/tmp/parallel_results_test/testEstderr_1 II 2 III /tmp/parallel_results_test/testEstderr 1 II 2 III
/tmp/parallel_results_test/testEstderr_1 II 2 IIII /tmp/parallel_results_test/testEstderr 1 II 2 IIII
/tmp/parallel_results_test/testEstdout_1 I 2 III /tmp/parallel_results_test/testEstdout 1 I 2 III
/tmp/parallel_results_test/testEstdout_1 I 2 IIII /tmp/parallel_results_test/testEstdout 1 I 2 IIII
/tmp/parallel_results_test/testEstdout_1 II 2 III /tmp/parallel_results_test/testEstdout 1 II 2 III
/tmp/parallel_results_test/testEstdout_1 II 2 IIII /tmp/parallel_results_test/testEstdout 1 II 2 IIII
### Test --results --header : ### Test --results --header :
I III I III
I IIII I IIII
II III II III
II IIII II IIII
/tmp/parallel_results_test/testBstderr_a I b III /tmp/parallel_results_test/testBstderr a I b III
/tmp/parallel_results_test/testBstderr_a I b IIII /tmp/parallel_results_test/testBstderr a I b IIII
/tmp/parallel_results_test/testBstderr_a II b III /tmp/parallel_results_test/testBstderr a II b III
/tmp/parallel_results_test/testBstderr_a II b IIII /tmp/parallel_results_test/testBstderr a II b IIII
/tmp/parallel_results_test/testBstdout_a I b III /tmp/parallel_results_test/testBstdout a I b III
/tmp/parallel_results_test/testBstdout_a I b IIII /tmp/parallel_results_test/testBstdout a I b IIII
/tmp/parallel_results_test/testBstdout_a II b III /tmp/parallel_results_test/testBstdout a II b III
/tmp/parallel_results_test/testBstdout_a II b IIII /tmp/parallel_results_test/testBstdout a II b IIII
### Test --results --header : ### Test --results --header :
I III I III
I IIII I IIII
II III II III
II IIII II IIII
/tmp/parallel_results_test/testCstderr_a I b III /tmp/parallel_results_test/testCstderr a I b III
/tmp/parallel_results_test/testCstderr_a I b IIII /tmp/parallel_results_test/testCstderr a I b IIII
/tmp/parallel_results_test/testCstderr_a II b III /tmp/parallel_results_test/testCstderr a II b III
/tmp/parallel_results_test/testCstderr_a II b IIII /tmp/parallel_results_test/testCstderr a II b IIII
/tmp/parallel_results_test/testCstdout_a I b III /tmp/parallel_results_test/testCstdout a I b III
/tmp/parallel_results_test/testCstdout_a I b IIII /tmp/parallel_results_test/testCstdout a I b IIII
/tmp/parallel_results_test/testCstdout_a II b III /tmp/parallel_results_test/testCstdout a II b III
/tmp/parallel_results_test/testCstdout_a II b IIII /tmp/parallel_results_test/testCstdout a II b IIII
### Test --results --header : piped ### Test --results --header : piped
/tmp/parallel_results_test/testF_stderr_Col backslash\\tab\tslash\_null\0eof /tmp/parallel_results_test/testF_stderr Col backslash\\tab\tslash\_null\0eof
/tmp/parallel_results_test/testF_stdout_Col backslash\\tab\tslash\_null\0eof /tmp/parallel_results_test/testF_stdout Col backslash\\tab\tslash\_null\0eof

View file

@ -22,7 +22,7 @@ a
ls b|wc;echo b ls b|wc;echo b
4 4 26 4 4 26
b b
ls 中国\ \(Zhōngguó\)|wc;echo 中国\ \(Zhōngguó\) ls \ä\¸\­\å\\½\ \(Zh\Å\<5C>nggu\Ã\³\)|wc;echo \ä\¸\­\å\\½\ \(Zh\Å\<5C>nggu\Ã\³\)
4 12 118 4 12 118
中国 (Zhōngguó) 中国 (Zhōngguó)
1 1-col.diff 1 1-col.diff
@ -47,7 +47,7 @@ touch -- 2-col/abc-2-col-2-col.diff
touch -- 2-col/abc-2-col-2-col.txt touch -- 2-col/abc-2-col-2-col.txt
touch -- a/abc-a-a touch -- a/abc-a-a
touch -- b/abc-b-b touch -- b/abc-b-b
touch -- 中国\ \(Zhōngguó\)/abc-中国\ \(Zhōngguó\)-中国\ \(Zhōngguó\) touch -- \ä\¸\­\å\\½\ \(Zh\Å\<5C>nggu\Ã\³\)/abc-\ä\¸\­\å\\½\ \(Zh\Å\<5C>nggu\Ã\³\)-\ä\¸\­\å\\½\ \(Zh\Å\<5C>nggu\Ã\³\)
rm -- 1-col/abc-1-col-1-col rm -- 1-col/abc-1-col-1-col
rm -- 1-col/abc-1-col-1-col.diff rm -- 1-col/abc-1-col-1-col.diff
rm -- 1-col/abc-1-col-1-col.txt rm -- 1-col/abc-1-col-1-col.txt
@ -56,7 +56,7 @@ rm -- 2-col/abc-2-col-2-col.diff
rm -- 2-col/abc-2-col-2-col.txt rm -- 2-col/abc-2-col-2-col.txt
rm -- a/abc-a-a rm -- a/abc-a-a
rm -- b/abc-b-b rm -- b/abc-b-b
rm -- 中国\ \(Zhōngguó\)/abc-中国\ \(Zhōngguó\)-中国\ \(Zhōngguó\) rm -- \ä\¸\­\å\\½\ \(Zh\Å\<5C>nggu\Ã\³\)/abc-\ä\¸\­\å\\½\ \(Zh\Å\<5C>nggu\Ã\³\)-\ä\¸\­\å\\½\ \(Zh\Å\<5C>nggu\Ã\³\)
### Test -m ### Test -m
1foo bar joe.gif2foo bar joe3 Afoo bar joeBfoo bar joeC 1foo bar joe.gif2foo bar joe3 Afoo bar joeBfoo bar joeC
1foo2foo3 1bar2bar3 1joe.gif2joe3 AfooBfooC AbarBbarC AjoeBjoeC 1foo2foo3 1bar2bar3 1joe.gif2joe3 AfooBfooC AbarBbarC AjoeBjoeC

View file

@ -2,5 +2,47 @@
1 1
2 2
3 3
### Test --env - https://savannah.gnu.org/bugs/?37351
a 2 spaces b 1
a 2 spaces b 1
a 2 spaces b 1
a 2 spaces b 1
a 2 spaces b 1
a 2 spaces b a > My brother's 12" records < b 2
a 2 spaces b a > My brother's 12" records < b 2
a 2 spaces b a > My brother's 12" records < b 2
a 2 spaces b a > My brother's 12" records < b 2
a 2 spaces b a > My brother's 12" records < b 2
a 2 spaces b a > My brother's 12" records < b 3
a 2 spaces b a > My brother's 12" records < b 3
a 2 spaces b a > My brother's 12" records < b 3
a 2 spaces b a > My brother's 12" records < b 3
a 2 spaces b a > My brother's 12" records < b 3
a \'"b 4
a \'"b 4
a \'"b 4
a \'"b 4
a \'"b 4
a' * ? >o <i*? ][\!#¤%=( ) | }b 5
a' * ? >o <i*? ][\!#¤%=( ) | }b 5
a' * ? >o <i*? ][\!#¤%=( ) | }b 5
a' * ? >o <i*? ][\!#¤%=( ) | }b 5
a' * ? >o <i*? ][\!#¤%=( ) | }b 5
### Test --env for \n and \\ - single and double - no output is good
2 setenv: Too many arguments.
1 export: Command not found.
1 V: Undefined variable.
2 1 10V2= 10
3 2\\ \92V2=\\ \92
1 2\ \92V2=\ \92
### Test --env for \n and \\ - single and double --onall - no output is good
2 setenv: Too many arguments.
1 export: Command not found.
1 V: Undefined variable.
2 1 10V2= 10
3 2\\ \92V2=\\ \92
1 2\ \92V2=\ \92
### Test --env for \160 - which kills csh - single and double - no output is good
### Test --env for \160 - which kills csh - single and double --onall - no output is good
### Test too slow spawning ### Test too slow spawning
OK OK

View file

@ -1,3 +1,5 @@
### Test --joblog with exitval and Test --joblog with signal ### Test --joblog with exitval and Test --joblog with signal
exitval OK exitval OK
signal OK signal OK
### Test --env all chars except \n,\92,\160 - single and double - no output is good
### Test --env all chars except \n,\92,\160 - single and double --onall - no output is good