From dd9d647e8106d23e7ebe79bce6a19b661e25258d Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Fri, 26 Dec 2014 11:44:02 +0100 Subject: [PATCH] parallel: quoting of ^ has changed. --- src/Makefile.in | 2 +- src/parallel | 8 +++++--- testsuite/wanted-results/parallel-local23 | 12 ++++++------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 16f9df9d..ba2715f3 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -78,7 +78,7 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/src/parallel b/src/parallel index fe03670c..ddd5a8b0 100755 --- a/src/parallel +++ b/src/parallel @@ -3375,6 +3375,9 @@ sub multiply_binary_prefix { # Returns: # $value = int with prefixes multiplied my $s = shift; + if(not $s) { + return $s; + } $s =~ s/ki/*1024/gi; $s =~ s/mi/*1024*1024/gi; $s =~ s/gi/*1024*1024*1024/gi; @@ -3994,7 +3997,6 @@ sub loadavg_too_high { }; $ps =~ s/[ \t\n]+/ /g; $cmd = "perl -e ".::shell_quote_scalar($ps); - $cmd =~ s/\^/\\^/g; } return $cmd; } @@ -4057,7 +4059,6 @@ sub loadavg { } else { $cmd .= loadavg_cmd(); } -# $cmd .= "ps ax -o state,command"; # As the command can take long to run if run remote # save it to a tmp file before moving it to the correct file ::debug("load", "Cmd: ", $cmd); @@ -7229,6 +7230,7 @@ sub new { my $return_files = shift; my @unget = (); my ($count,$posrpl,$perlexpr); + my ($replacecount_ref, $len_ref); my @command = @$commandref; # If the first command start with '-' it is probably an option if($command[0] =~ /^\s*(-\S+)/) { @@ -7283,7 +7285,7 @@ sub new { } } # Add {} if no replacement strings in @command - my($replacecount_ref, $len_ref, @command) = + ($replacecount_ref, $len_ref, @command) = replacement_counts_and_lengths(@command); if("@command" =~ /^\S*\257 +This is free software: you are free to change and redistribute it. GNU parallel comes with no warranty. Web site: http://www.gnu.org/software/parallel -When using programs that use GNU Parallel to process data for publication please cite: - -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. +When using programs that use GNU Parallel to process data for publication +please cite as described in 'parallel --bibtex'. echo '### 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"'