parallel: quoting of ^ has changed.

This commit is contained in:
Ole Tange 2014-12-26 11:44:02 +01:00
parent 09343427ec
commit dd9d647e81
3 changed files with 12 additions and 10 deletions

View file

@ -78,7 +78,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
subdir = src subdir = src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am README
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \

View file

@ -3375,6 +3375,9 @@ sub multiply_binary_prefix {
# Returns: # Returns:
# $value = int with prefixes multiplied # $value = int with prefixes multiplied
my $s = shift; my $s = shift;
if(not $s) {
return $s;
}
$s =~ s/ki/*1024/gi; $s =~ s/ki/*1024/gi;
$s =~ s/mi/*1024*1024/gi; $s =~ s/mi/*1024*1024/gi;
$s =~ s/gi/*1024*1024*1024/gi; $s =~ s/gi/*1024*1024*1024/gi;
@ -3994,7 +3997,6 @@ sub loadavg_too_high {
}; };
$ps =~ s/[ \t\n]+/ /g; $ps =~ s/[ \t\n]+/ /g;
$cmd = "perl -e ".::shell_quote_scalar($ps); $cmd = "perl -e ".::shell_quote_scalar($ps);
$cmd =~ s/\^/\\^/g;
} }
return $cmd; return $cmd;
} }
@ -4057,7 +4059,6 @@ sub loadavg {
} else { } else {
$cmd .= loadavg_cmd(); $cmd .= loadavg_cmd();
} }
# $cmd .= "ps ax -o state,command";
# As the command can take long to run if run remote # As the command can take long to run if run remote
# save it to a tmp file before moving it to the correct file # save it to a tmp file before moving it to the correct file
::debug("load", "Cmd: ", $cmd); ::debug("load", "Cmd: ", $cmd);
@ -7229,6 +7230,7 @@ sub new {
my $return_files = shift; my $return_files = shift;
my @unget = (); my @unget = ();
my ($count,$posrpl,$perlexpr); my ($count,$posrpl,$perlexpr);
my ($replacecount_ref, $len_ref);
my @command = @$commandref; my @command = @$commandref;
# If the first command start with '-' it is probably an option # If the first command start with '-' it is probably an option
if($command[0] =~ /^\s*(-\S+)/) { if($command[0] =~ /^\s*(-\S+)/) {
@ -7283,7 +7285,7 @@ sub new {
} }
} }
# Add {} if no replacement strings in @command # Add {} if no replacement strings in @command
my($replacecount_ref, $len_ref, @command) = ($replacecount_ref, $len_ref, @command) =
replacement_counts_and_lengths(@command); replacement_counts_and_lengths(@command);
if("@command" =~ /^\S*\257</) { if("@command" =~ /^\S*\257</) {
# Replacement string is (part of) the command (and not just argument) # Replacement string is (part of) the command (and not just argument)

View file

@ -73,16 +73,16 @@ echo '### Check that 4 processes are really used'
echo '### --version must have higher priority than retired options' echo '### --version must have higher priority than retired options'
### --version must have higher priority than retired options ### --version must have higher priority than retired options
$NICEPAR --version -g -Y -U -W -T | tail $NICEPAR --version -g -Y -U -W -T | tail
GNU parallel 20141212
Copyright (C) 2007,2008,2009,2010,2011,2012,2013,2014 Ole Tange and Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
GNU parallel comes with no warranty. GNU parallel comes with no warranty.
Web site: http://www.gnu.org/software/parallel Web site: http://www.gnu.org/software/parallel
When using programs that use GNU Parallel to process data for publication please cite: When using programs that use GNU Parallel to process data for publication
please cite as described in 'parallel --bibtex'.
O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
;login: The USENIX Magazine, February 2011:42-47.
Or you can get GNU Parallel without this requirement by paying 10000 EUR.
echo '### bug #39787: --xargs broken' echo '### bug #39787: --xargs broken'
### bug #39787: --xargs broken ### bug #39787: --xargs broken
nice perl -e 'for(1..30000){print "$_\n"}' | $NICEPAR --xargs -k echo | perl -ne 'print length $_,"\n"' nice perl -e 'for(1..30000){print "$_\n"}' | $NICEPAR --xargs -k echo | perl -ne 'print length $_,"\n"'