parallel: --gnu was ignored if env var started with space: PARALLEL=' --gnu'

This commit is contained in:
Ole Tange 2014-01-13 04:57:40 +01:00
parent dd1146b065
commit 96010cc2ed
5 changed files with 23 additions and 4 deletions

View file

@ -211,12 +211,25 @@ available for download at: http://ftp.gnu.org/gnu/parallel/
New in this release:
* GNU Parallel was cited in: On the likelihood of multiple bit upsets
in logic circuits
http://arxiv-web3.library.cornell.edu/pdf/1401.1003
* HaploClique uses GNU Parallel
https://github.com/armintoepfer/haploclique
* 30 Cool Open Source Software I Discovered in 2013
http://www.cyberciti.biz/open-source/30-cool-best-open-source-softwares-of-2013/
* [Unix] 13. The power of doing things in Parallel
http://leetaey.tistory.com/384
* Parallel the execution of a job that read from stdin
http://www.linuxask.com/questions/parallel-the-execution-of-a-job-that-read-from-stdin
* Shell-Abarbeitung beschleunigen: Wie Sie mit parallelen Prozesse effizienter in der Shell arbeiten
https://www.hosteurope.ch/blog/shell-abarbeitung-beschleunigen-wie-sie-mit-parallelen-prozesse-effizienter-in-der-shell-arbeiten/
* Bug fixes and man page updates.

View file

@ -625,7 +625,7 @@ sub get_options_from_array {
sub parse_options {
# Returns: N/A
# Defaults:
$Global::version = 20140103;
$Global::version = 20140113;
$Global::progname = 'parallel';
$Global::infinity = 2**31;
$Global::debug = 0;
@ -1119,7 +1119,8 @@ sub read_options {
}
# Add options from shell variable $PARALLEL
if($ENV{'PARALLEL'}) {
@ARGV_env = shell_unquote(split/(?<![\\])\s/, $ENV{'PARALLEL'});
# Split options on space, but ignore empty options
@ARGV_env = grep { /./ } shell_unquote(split/(?<![\\])\s/, $ENV{'PARALLEL'});
}
}
Getopt::Long::Configure("bundling","require_order");
@ -5505,7 +5506,7 @@ sub replaced {
if($self->{'replaced'} =~ /^\s*(-\S+)/) {
# Is this really a command in $PATH starting with '-'?
my $cmd = $1;
if(not which($cmd)) {
if(not ::which($cmd)) {
::error("Command ($cmd) starts with '-'. Is this a wrong option?\n");
::wait_and_exit(255);
}

View file

@ -151,4 +151,7 @@ echo 'bug #34241: --pipe should not spawn unneeded processes - part 2'
echo No .par should exist;
stdout ls *.par
echo "bug: --gnu was ignored if env var started with space: PARALLEL=' --gnu'"
export PARALLEL=" -v" && parallel echo ::: 'space in envvar OK'
EOF

View file

@ -263,3 +263,6 @@ bug #34241: --pipe should not spawn unneeded processes - part 2
2
No .par should exist
ls: cannot access *.par: No such file or directory
bug: --gnu was ignored if env var started with space: PARALLEL=' --gnu'
echo space\ in\ envvar\ OK
space in envvar OK

View file

@ -65,4 +65,3 @@ hurd.polarhome.com Works on hurd.polarhome.com
copy_and_test raspberrypi.polarhome.com
raspberrypi.polarhome.com ### Run the test on raspberrypi.polarhome.com
raspberrypi.polarhome.com Works on raspberrypi.polarhome.com
raspberrypi.polarhome.com parallel: Warning: Cannot figure out number of CPU cores. Using 1.