mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-22 05:57:54 +00:00
parallel: --plus bug in {+.}/{+..}/{+...}.
This commit is contained in:
parent
06d992e1cf
commit
9b3066e071
|
@ -4,6 +4,12 @@
|
||||||
|
|
||||||
Quote of the month:
|
Quote of the month:
|
||||||
|
|
||||||
|
GNU parallelという神ツールを発見した
|
||||||
|
-- @schnell1232@twitter
|
||||||
|
|
||||||
|
How I love GNU parallel
|
||||||
|
-- @dathanvp@twitter Dathan Pattishall
|
||||||
|
|
||||||
GNU Parallelめっちゃ便利で偉い
|
GNU Parallelめっちゃ便利で偉い
|
||||||
-- аiгbus @airbus_P
|
-- аiгbus @airbus_P
|
||||||
|
|
||||||
|
|
|
@ -385,7 +385,7 @@ _parset_main() {
|
||||||
return 255
|
return 255
|
||||||
fi
|
fi
|
||||||
if [ "$_parset_NAME" = "--version" ] ; then
|
if [ "$_parset_NAME" = "--version" ] ; then
|
||||||
echo "parset 20211022 (GNU parallel `parallel --minversion 1`)"
|
echo "parset 20211023 (GNU parallel `parallel --minversion 1`)"
|
||||||
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
||||||
echo "Foundation, Inc."
|
echo "Foundation, Inc."
|
||||||
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
||||||
|
|
|
@ -384,7 +384,7 @@ _parset_main() {
|
||||||
return 255
|
return 255
|
||||||
fi
|
fi
|
||||||
if [ "$_parset_NAME" = "--version" ] ; then
|
if [ "$_parset_NAME" = "--version" ] ; then
|
||||||
echo "parset 20211022 (GNU parallel `parallel --minversion 1`)"
|
echo "parset 20211023 (GNU parallel `parallel --minversion 1`)"
|
||||||
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
||||||
echo "Foundation, Inc."
|
echo "Foundation, Inc."
|
||||||
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
||||||
|
|
|
@ -385,7 +385,7 @@ _parset_main() {
|
||||||
return 255
|
return 255
|
||||||
fi
|
fi
|
||||||
if [ "$_parset_NAME" = "--version" ] ; then
|
if [ "$_parset_NAME" = "--version" ] ; then
|
||||||
echo "parset 20211022 (GNU parallel `parallel --minversion 1`)"
|
echo "parset 20211023 (GNU parallel `parallel --minversion 1`)"
|
||||||
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
||||||
echo "Foundation, Inc."
|
echo "Foundation, Inc."
|
||||||
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
||||||
|
|
|
@ -363,7 +363,7 @@ _parset_main() {
|
||||||
return 255
|
return 255
|
||||||
fi
|
fi
|
||||||
if [ "$_parset_NAME" = "--version" ] ; then
|
if [ "$_parset_NAME" = "--version" ] ; then
|
||||||
echo "parset 20211022 (GNU parallel `parallel --minversion 1`)"
|
echo "parset 20211023 (GNU parallel `parallel --minversion 1`)"
|
||||||
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
||||||
echo "Foundation, Inc."
|
echo "Foundation, Inc."
|
||||||
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
||||||
|
|
|
@ -365,7 +365,7 @@ _parset_main() {
|
||||||
return 255
|
return 255
|
||||||
fi
|
fi
|
||||||
if [ "$_parset_NAME" = "--version" ] ; then
|
if [ "$_parset_NAME" = "--version" ] ; then
|
||||||
echo "parset 20211022 (GNU parallel `parallel --minversion 1`)"
|
echo "parset 20211023 (GNU parallel `parallel --minversion 1`)"
|
||||||
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
||||||
echo "Foundation, Inc."
|
echo "Foundation, Inc."
|
||||||
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
||||||
|
|
|
@ -390,7 +390,7 @@ _parset_main() {
|
||||||
return 255
|
return 255
|
||||||
fi
|
fi
|
||||||
if [ "$_parset_NAME" = "--version" ] ; then
|
if [ "$_parset_NAME" = "--version" ] ; then
|
||||||
echo "parset 20211022 (GNU parallel `parallel --minversion 1`)"
|
echo "parset 20211023 (GNU parallel `parallel --minversion 1`)"
|
||||||
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
||||||
echo "Foundation, Inc."
|
echo "Foundation, Inc."
|
||||||
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
||||||
|
|
|
@ -355,7 +355,7 @@ _parset_main() {
|
||||||
return 255
|
return 255
|
||||||
fi
|
fi
|
||||||
if [ "$_parset_NAME" = "--version" ] ; then
|
if [ "$_parset_NAME" = "--version" ] ; then
|
||||||
echo "parset 20211022 (GNU parallel `parallel --minversion 1`)"
|
echo "parset 20211023 (GNU parallel `parallel --minversion 1`)"
|
||||||
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
echo "Copyright (C) 2007-2021 Ole Tange, http://ole.tange.dk and Free Software"
|
||||||
echo "Foundation, Inc."
|
echo "Foundation, Inc."
|
||||||
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
use strict;
|
use strict;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
$Global::progname="niceload";
|
$Global::progname="niceload";
|
||||||
$Global::version = 20211022;
|
$Global::version = 20211023;
|
||||||
Getopt::Long::Configure("bundling","require_order");
|
Getopt::Long::Configure("bundling","require_order");
|
||||||
get_options_from_array(\@ARGV) || die_usage();
|
get_options_from_array(\@ARGV) || die_usage();
|
||||||
if($opt::version) {
|
if($opt::version) {
|
||||||
|
|
20
src/parallel
20
src/parallel
|
@ -2264,7 +2264,7 @@ sub check_invalid_option_combinations() {
|
||||||
|
|
||||||
sub init_globals() {
|
sub init_globals() {
|
||||||
# Defaults:
|
# Defaults:
|
||||||
$Global::version = 20211022;
|
$Global::version = 20211023;
|
||||||
$Global::progname = 'parallel';
|
$Global::progname = 'parallel';
|
||||||
$::name = "GNU Parallel";
|
$::name = "GNU Parallel";
|
||||||
$Global::infinity = 2**31;
|
$Global::infinity = 2**31;
|
||||||
|
@ -2295,14 +2295,16 @@ sub init_globals() {
|
||||||
# = {.}.{+.} = {+/}/{/.}.{+.}
|
# = {.}.{+.} = {+/}/{/.}.{+.}
|
||||||
# = {..}.{+..} = {+/}/{/..}.{+..}
|
# = {..}.{+..} = {+/}/{/..}.{+..}
|
||||||
# = {...}.{+...} = {+/}/{/...}.{+...}
|
# = {...}.{+...} = {+/}/{/...}.{+...}
|
||||||
'{+/}' => 's:/[^/]*$::',
|
'{+/}' => 's:/[^/]*$:: || s:.*$::',
|
||||||
'{+.}' => 's:.*\.::',
|
# a.b => b; a => ''
|
||||||
'{+..}' => 's:.*\.([^.]*\.):$1:',
|
'{+.}' => 's:.*\.:: || s:.*$::',
|
||||||
'{+...}' => 's:.*\.([^.]*\.[^.]*\.):$1:',
|
# a.b.c => b.c; a.b => ''; a => ''
|
||||||
'{..}' => 's:\.[^/.]+$::; s:\.[^/.]+$::',
|
'{+..}' => 's:.*\.([^/.]+\.[^/.]+)$:$1: || s:.*$::',
|
||||||
'{...}' => 's:\.[^/.]+$::; s:\.[^/.]+$::; s:\.[^/.]+$::',
|
'{+...}' => 's:.*\.([^/.]+\.[^/.]+\.[^/.]+)$:$1: || s:.*$::',
|
||||||
'{/..}' => 's:.*/::; s:\.[^/.]+$::; s:\.[^/.]+$::',
|
'{..}' => 's:\.[^/.]+\.[^/.]+$::',
|
||||||
'{/...}' => 's:.*/::; s:\.[^/.]+$::; s:\.[^/.]+$::; s:\.[^/.]+$::',
|
'{...}' => 's:\.[^/.]+\.[^/.]+\.[^/.]+$::',
|
||||||
|
'{/..}' => 's:.*/::; s:\.[^/.]+\.[^/.]+$::',
|
||||||
|
'{/...}' => 's:.*/::; s:\.[^/.]+\.[^/.]+\.[^/.]+$::',
|
||||||
# n choose k = Binomial coefficient
|
# n choose k = Binomial coefficient
|
||||||
'{choose_k}' => 'for $t (2..$#arg){ if($arg[$t-1] ge $arg[$t]) { skip() } }',
|
'{choose_k}' => 'for $t (2..$#arg){ if($arg[$t-1] ge $arg[$t]) { skip() } }',
|
||||||
# {##} = number of jobs
|
# {##} = number of jobs
|
||||||
|
|
|
@ -122,7 +122,7 @@ GetOptions(
|
||||||
"help" => \$opt::dummy,
|
"help" => \$opt::dummy,
|
||||||
) || exit(255);
|
) || exit(255);
|
||||||
$Global::progname = ($0 =~ m:(^|/)([^/]+)$:)[1];
|
$Global::progname = ($0 =~ m:(^|/)([^/]+)$:)[1];
|
||||||
$Global::version = 20211022;
|
$Global::version = 20211023;
|
||||||
if($opt::version) { version(); exit 0; }
|
if($opt::version) { version(); exit 0; }
|
||||||
@Global::sortoptions = grep { ! /^-D$/ }
|
@Global::sortoptions = grep { ! /^-D$/ }
|
||||||
shell_quote(@ARGV_before[0..($#ARGV_before-$#ARGV-1)]);
|
shell_quote(@ARGV_before[0..($#ARGV_before-$#ARGV-1)]);
|
||||||
|
|
2
src/sql
2
src/sql
|
@ -600,7 +600,7 @@ $Global::Initfile && unlink $Global::Initfile;
|
||||||
exit ($err);
|
exit ($err);
|
||||||
|
|
||||||
sub parse_options {
|
sub parse_options {
|
||||||
$Global::version = 20211022;
|
$Global::version = 20211023;
|
||||||
$Global::progname = 'sql';
|
$Global::progname = 'sql';
|
||||||
|
|
||||||
# This must be done first as this may exec myself
|
# This must be done first as this may exec myself
|
||||||
|
|
|
@ -24,7 +24,14 @@ par_ctagstring() {
|
||||||
parallel --ctagstring 'I{1}\tB{2}' echo ::: 1 ::: a | wc -c
|
parallel --ctagstring 'I{1}\tB{2}' echo ::: 1 ::: a | wc -c
|
||||||
}
|
}
|
||||||
|
|
||||||
par_pct() {
|
par_plus() {
|
||||||
|
echo '### --plus'
|
||||||
|
echo '(It is OK to start with extra / or end with extra .)'
|
||||||
|
parallel -k --plus echo {} = {+/}/{/} = {.}.{+.} = {+/}/{/.}.{+.} = \
|
||||||
|
{..}.{+..} = {+/}/{/..}.{+..} = {...}.{+...} = \
|
||||||
|
{+/}/{/...}.{+...} \
|
||||||
|
::: a a.b a.b.c a.b.c.d a/1 a.b/1.2 a.b.c/1.2.3 a.b.c.d/1.2.3.4
|
||||||
|
|
||||||
echo '### Test {%...} {%%...} {#...} {##...}'
|
echo '### Test {%...} {%%...} {#...} {##...}'
|
||||||
a=z.z.z.foo
|
a=z.z.z.foo
|
||||||
echo ${a#z*z.}
|
echo ${a#z*z.}
|
||||||
|
|
|
@ -560,15 +560,6 @@ par_parcat_args_stdin OK2
|
||||||
par_parcat_rm bug #51691: parcat --rm remove fifo when opened
|
par_parcat_rm bug #51691: parcat --rm remove fifo when opened
|
||||||
par_parcat_rm OK1
|
par_parcat_rm OK1
|
||||||
par_parcat_rm OK file removed
|
par_parcat_rm OK file removed
|
||||||
par_pct ### Test {%...} {%%...} {#...} {##...}
|
|
||||||
par_pct z.foo
|
|
||||||
par_pct z.foo
|
|
||||||
par_pct foo
|
|
||||||
par_pct foo
|
|
||||||
par_pct foo.z
|
|
||||||
par_pct foo.z
|
|
||||||
par_pct foo
|
|
||||||
par_pct foo
|
|
||||||
par_perlexpr_with_newline Perl expression spanning 2 lines
|
par_perlexpr_with_newline Perl expression spanning 2 lines
|
||||||
par_pipe_N1_regexp bug #55131: --regexp --recstart hangs
|
par_pipe_N1_regexp bug #55131: --regexp --recstart hangs
|
||||||
par_pipe_N1_regexp These should give the same
|
par_pipe_N1_regexp These should give the same
|
||||||
|
@ -727,6 +718,25 @@ par_pipepart_recend_recstart 9
|
||||||
par_pipepart_recend_recstart 10
|
par_pipepart_recend_recstart 10
|
||||||
par_pipepart_roundrobin ### bug #45769: --round-robin --pipepart gives wrong results
|
par_pipepart_roundrobin ### bug #45769: --round-robin --pipepart gives wrong results
|
||||||
par_pipepart_roundrobin 2
|
par_pipepart_roundrobin 2
|
||||||
|
par_plus ### --plus
|
||||||
|
par_plus (It is OK to start with extra / or end with extra .)
|
||||||
|
par_plus a = /a = a. = /a. = a. = /a. = a. = /a.
|
||||||
|
par_plus a.b = /a.b = a.b = /a.b = a.b. = /a.b. = a.b. = /a.b.
|
||||||
|
par_plus a.b.c = /a.b.c = a.b.c = /a.b.c = a.b.c = /a.b.c = a.b.c. = /a.b.c.
|
||||||
|
par_plus a.b.c.d = /a.b.c.d = a.b.c.d = /a.b.c.d = a.b.c.d = /a.b.c.d = a.b.c.d = /a.b.c.d
|
||||||
|
par_plus a/1 = a/1 = a/1. = a/1. = a/1. = a/1. = a/1. = a/1.
|
||||||
|
par_plus a.b/1.2 = a.b/1.2 = a.b/1.2 = a.b/1.2 = a.b/1.2. = a.b/1.2. = a.b/1.2. = a.b/1.2.
|
||||||
|
par_plus a.b.c/1.2.3 = a.b.c/1.2.3 = a.b.c/1.2.3 = a.b.c/1.2.3 = a.b.c/1.2.3 = a.b.c/1.2.3 = a.b.c/1.2.3. = a.b.c/1.2.3.
|
||||||
|
par_plus a.b.c.d/1.2.3.4 = a.b.c.d/1.2.3.4 = a.b.c.d/1.2.3.4 = a.b.c.d/1.2.3.4 = a.b.c.d/1.2.3.4 = a.b.c.d/1.2.3.4 = a.b.c.d/1.2.3.4 = a.b.c.d/1.2.3.4
|
||||||
|
par_plus ### Test {%...} {%%...} {#...} {##...}
|
||||||
|
par_plus z.foo
|
||||||
|
par_plus z.foo
|
||||||
|
par_plus foo
|
||||||
|
par_plus foo
|
||||||
|
par_plus foo.z
|
||||||
|
par_plus foo.z
|
||||||
|
par_plus foo
|
||||||
|
par_plus foo
|
||||||
par_profile ### Test -J profile, -J /dir/profile, -J ./profile
|
par_profile ### Test -J profile, -J /dir/profile, -J ./profile
|
||||||
par_profile local local
|
par_profile local local
|
||||||
par_profile abs abs
|
par_profile abs abs
|
||||||
|
|
Loading…
Reference in a new issue