parallel: -a file1 -a +file2 will link file2 to file1.

This commit is contained in:
Ole Tange 2023-11-03 22:56:46 +01:00
parent 4c3396c31c
commit 2bc95e8f06
9 changed files with 374 additions and 119 deletions

12
NEWS
View file

@ -1,3 +1,15 @@
20231122
New in this release:
* -a file1 -a +file2 will link file2 to file1 similar to ::::+
* Bug fixes and man page updates.
News about GNU Parallel:
20231022 20231022
New in this release: New in this release:

View file

@ -274,24 +274,23 @@ from:tange@gnu.org
to:parallel@gnu.org, bug-parallel@gnu.org to:parallel@gnu.org, bug-parallel@gnu.org
stable-bcc: Jesse Alama <jessealama@fastmail.fm> stable-bcc: Jesse Alama <jessealama@fastmail.fm>
Subject: GNU Parallel 20231022 ('Al-Aqsa Deluge') released [stable] Subject: GNU Parallel 20231122 ('Perry<<>>') released <<[stable]>>
GNU Parallel 20231022 ('Al-Aqsa Deluge') has been released. It is available for download at: lbry://@GnuParallel:4 GNU Parallel 20231122 ('<<>>') has been released. It is available for download at: lbry://@GnuParallel:4
Quote of the month: Quote of the month:
Love to make a dual processor workstation absolutely whir running dozens of analysis scripts at once <<>>
-- Best Catboy Key Grip @alamogordoglass@twitter
New in this release: New in this release:
* -a file1 -a +file2 will link file2 to file1 similar to ::::+
* Bug fixes and man page updates. * Bug fixes and man page updates.
News about GNU Parallel: News about GNU Parallel:
* Resume long parallel jobs https://ginolhac.github.io/posts/2023-10-02_resume-parallel/index.html <<>>
* Efficiency and Speed with GNU Parallel https://dev.to/0xog_pg/efficiency-and-speed-with-gnu-parallel-loo
GNU Parallel - For people who live life in the parallel lane. GNU Parallel - For people who live life in the parallel lane.

View file

@ -2522,10 +2522,8 @@ sub parse_options(@) {
not ($opt::xargs or $opt::m)) { not ($opt::xargs or $opt::m)) {
$Global::ContextReplace = 1; $Global::ContextReplace = 1;
} }
if(grep /^$Global::arg_sep\+?$|^$Global::arg_file_sep\+?$/o, @ARGV) { # Deal with ::: :::+ :::: ::::+ and -a +file
# Deal with ::: :::+ :::: and ::::+
@ARGV = read_args_from_command_line(); @ARGV = read_args_from_command_line();
}
parse_semaphore(); parse_semaphore();
if(defined $opt::eta) { $opt::progress = $opt::eta; } if(defined $opt::eta) { $opt::progress = $opt::eta; }
@ -3524,76 +3522,136 @@ sub read_args_from_command_line() {
# @opt::a # @opt::a
# Returns: # Returns:
# @argv_no_argsep = @::ARGV without ::: and :::: and following args # @argv_no_argsep = @::ARGV without ::: and :::: and following args
my @new_argv = (); my %group_sep = ($Global::arg_sep => ":::",
for(my $arg = shift @ARGV; @ARGV; $arg = shift @ARGV) { $Global::arg_sep."+" => ":::+",
if($arg eq $Global::arg_sep $Global::arg_file_sep => "::::",
or $Global::arg_file_sep."+" => "::::+");
$arg eq $Global::arg_sep."+" sub is_linked($) {
or # file is linked if file starts with +
$arg eq $Global::arg_file_sep local $_ = shift;
or if(/^\+(.*)/) {
$arg eq $Global::arg_file_sep."+") { my $noplus = $1;
my $group_sep = $arg; # This group of args is args or argfiles if(-e $_ and -e $noplus) {
my @group; ::error("It is unclear whether you mean +./$noplus or ./+$noplus");
while(defined ($arg = shift @ARGV)) { wait_and_exit(255);
if($arg eq $Global::arg_sep } elsif(-e $_ and not -e $noplus) {
or # This is ./+file = this is not linked
$arg eq $Global::arg_sep."+" return 0;
or } elsif(not -e $_ and -e $noplus) {
$arg eq $Global::arg_file_sep # This is +./file = this is linked
or return 1;
$arg eq $Global::arg_file_sep."+") { } elsif(not -e $_ and not -e $noplus) {
# exit while loop if finding new separator # File does not exist, maybe it is stdin?
if($_ eq "-") {
# This is - = this is not linked
return 0;
} elsif($_ eq "+-") {
# This is +- = this is linked
return 1;
} else {
::error("File not found: $_");
wait_and_exit(255);
}
} else {
::die_bug("noplus: $noplus $_");
}
}
# not linked
return 0;
}
sub cmd_template() {
# remove command template from @ARGV
# keep ::: / :::: in @ARGV if any
my @cmd_template;
while(@ARGV) {
my $arg = shift @ARGV;
if($group_sep{$arg}) {
# Found separator: push it back and exit loop
unshift @ARGV, $arg;
last; last;
}
push @cmd_template, $arg;
}
return @cmd_template;
}
sub divide_into_groups() {
# Split arguments from @ARGV into groups:
# ::: 1 2 3 :::: a b c ::::+ d e f
# =>
# [ ::: 1 2 3 ], [ :::: a b c ], [ ::::+ d e f ]
my @g;
my @grp;
while(@ARGV) {
my $arg = shift @ARGV;
if($group_sep{$arg}) {
# start a new group
push @grp, [@g];
@g = ($group_sep{$arg});
} else { } else {
# If not hitting ::: :::+ :::: or ::::+ push @g, $arg;
# Append it to the group
push @group, $arg;
} }
} }
my $is_linked = ($group_sep =~ /\+$/) ? 1 : 0; push @grp, [@g];
my $is_file = ($group_sep eq $Global::arg_file_sep shift @grp; # The first will always be empty
or return @grp;
$group_sep eq $Global::arg_file_sep."+");
if($is_file) {
# :::: / ::::+
push @opt::linkinputsource, map { $is_linked } @group;
} else {
# ::: / :::+
push @opt::linkinputsource, $is_linked;
} }
if($is_file sub save_to_file(@) {
or ($opt::_pipe_means_argfiles and $opt::pipe) # Put args into a file, return open file handle of file
) {
# Group of file names on the command line.
# Append args into -a
push @opt::a, @group;
} else {
# Group of arguments on the command line.
# Put them into a file.
# Create argfile # Create argfile
my ($outfh,$name) = ::tmpfile(SUFFIX => ".arg"); my ($fh,$name) = ::tmpfile(SUFFIX => ".arg");
unlink($name); unlink($name);
# Put args into argfile # Put args into argfile
print $outfh map { $_,$/ } @group; print $fh map { $_,$/ } @_;
seek $outfh, 0, 0; seek $fh, 0, 0;
exit_if_disk_full(); exit_if_disk_full();
# Append filehandle to -a return $fh;
push @opt::a, $outfh;
} }
if(defined($arg)) { my @cmd = cmd_template();
# $arg is ::: :::+ :::: or ::::+ # The rest of @ARGV is ::: / :::: args
# so there is another group # If there are any -a: Rewrite them to use ::::
redo; if(@opt::a) { unshift @ARGV, $Global::arg_file_sep, @opt::a; }
@opt::a = ();
# Convert ::: and :::: into (linked) files and put those into @opt::a
for my $g_ref (divide_into_groups()) {
my $group_sep = shift @$g_ref;
if($group_sep eq ":::" or $group_sep eq ":::+") {
# Group starts with ::: / :::+
if($opt::_pipe_means_argfiles and $#$g_ref < 0) {
# TODO
# Deal with --shebang-wrap and ::: on the shebang line
} else { } else {
# $arg is undef -> @ARGV empty push @opt::a, save_to_file(@$g_ref);
last; # if $group_sep == ":::+": it is linked
push @opt::linkinputsource, ($group_sep eq ":::+");
}
} elsif($group_sep eq "::::" or $group_sep eq "::::+") {
# Group starts with :::: / ::::+
for my $f (@$g_ref) {
if($group_sep eq "::::+") {
# Linking forced
push @opt::a, $f;
push @opt::linkinputsource, 1;
} elsif($group_sep eq "::::") {
# Auto detect linking
if(is_linked($f)) {
# +file
push @opt::linkinputsource, 1;
$f =~ s/^\+//;
} else {
# file (no plus)
push @opt::linkinputsource, 0;
}
push @opt::a, $f;
} else {
::die_bug("arg link error");
} }
} }
push @new_argv, $arg; } else {
::die_bug("arg link error");
} }
# Output: @ARGV = command to run with options }
return @new_argv; # Output: command to run with options
return @cmd;
} }
sub cleanup() { sub cleanup() {

View file

@ -536,16 +536,12 @@ Shorthand for B<--delimiter '\0'>.
See also: B<--delimiter> See also: B<--delimiter>
=item B<--arg-file> I<input-file> =item B<--arg-file> I<input-file> (alpha testing)
=item B<-a> I<input-file> =item B<-a> I<input-file> (alpha testing)
Use I<input-file> as input source. Use I<input-file> as input source.
If you use this option, stdin (standard input) is given to the first
process run. Otherwise, stdin (standard input) is redirected from
/dev/null.
If multiple B<--arg-file> are given, each I<input-file> will be treated as an If multiple B<--arg-file> are given, each I<input-file> will be treated as an
input source, and all combinations of input sources will be input source, and all combinations of input sources will be
generated. E.g. The file B<foo> contains B<1 2>, the file generated. E.g. The file B<foo> contains B<1 2>, the file
@ -553,6 +549,12 @@ B<bar> contains B<a b c>. B<-a foo> B<-a bar> will result in the combinations
(1,a) (1,b) (1,c) (2,a) (2,b) (2,c). This is useful for replacing (1,a) (1,b) (1,c) (2,a) (2,b) (2,c). This is useful for replacing
nested for-loops. nested for-loops.
If I<input-file> starts with B<+> the file will be linked to the
previous B<--arg-file> E.g. The file B<foo> contains B<1 2>, the file
B<bar> contains B<a b>. B<-a foo> B<-a +bar> will result in the
combinations (1,a) (2,b) like B<--link> instead of generating all
combinations.
See also: B<--link> B<{>I<n>B<}> B<::::> B<::::+> B<:::> See also: B<--link> B<{>I<n>B<}> B<::::> B<::::+> B<:::>

View file

@ -8,6 +8,53 @@
# Each should be taking 3-10s and be possible to run in parallel # Each should be taking 3-10s and be possible to run in parallel
# I.e.: No race conditions, no logins # I.e.: No race conditions, no logins
par__argfile_plus() {
tmp=$(mktemp -d)
(
p() {
echo -- -a $1 $2 $3
stdout parallel -k -a $1 -a $2 -a $3 echo;
}
q() {
echo :::: $1 $2 $3
stdout parallel -k echo :::: $1 $2 $3;
}
cd "$tmp"
seq 3 > file
seq 4 6 > +file
seq 7 9 > ++file
p file +file ++file
p file +./file ++file
p file ./+file ++file
p file +file +./+file
p file +./file +./+file
p file ./+file +./+file
p file +file ./++file
p file +./file ./++file
p file ./+file ./++file
q file +file ++file
q file +./file ++file
q file ./+file ++file
q file +file +./+file
q file +./file +./+file
q file ./+file +./+file
q file +file ./++file
q file +./file ./++file
q file ./+file ./++file
seq 10 12 | p ./file ./++file -
seq 10 12 | p ./file +./+file +-
seq 10 12 | p ./file +- ./+file
)
rm -r "$tmp"
}
par_process_slot_var() { par_process_slot_var() {
echo '### bug #62310: xargs compatibility: --process-slot-var=name' echo '### bug #62310: xargs compatibility: --process-slot-var=name'
seq 0.1 0.4 1.8 | seq 0.1 0.4 1.8 |

View file

@ -50,4 +50,4 @@ par_load_file_more_10s() {
export -f $(compgen -A function | grep par_) export -f $(compgen -A function | grep par_)
#compgen -A function | grep par_ | sort | parallel --delay $D -j$P --tag -k '{} 2>&1' #compgen -A function | grep par_ | sort | parallel --delay $D -j$P --tag -k '{} 2>&1'
compgen -A function | grep par_ | sort | compgen -A function | grep par_ | sort |
parallel --joblog /tmp/jl-`basename $0` -j200% --tag -k '{} 2>&1' parallel --timeout 30s --joblog /tmp/jl-`basename $0` -j200% --tag -k '{} 2>&1'

View file

@ -120,7 +120,13 @@ perl -ne '$/="\n\n"; /^Output/../^[^O]\S/ and next; /^ / and print;' "$testsuit
s:par......par:tempfile:g; s:par......par:tempfile:g;
s:^tempfile\n::g; s:^tempfile\n::g;
# --progress => 1:local / 4 / 4 # --progress => 1:local / 4 / 4
s,1:local / . / .,1:local / 9 / 9, s,1:local / . / .,1:local / 9 / 9,;
# bash: -c: line 1: .set a="tempfile"; if( { test -d "$a" } ) echo "$a is a dir"
s{.*bash: .*set a=".*".*test -d.*is a dir.*\n}{};
# /usr/bin/bash: -c: line 1: syntax error near unexpected token .)
s{.*bash: .*syntax error near unexpected token.*\n}{};
# This is input_file
s{^This is input_file.*\n}{};
' | uniq ' | uniq
echo "### 3+3 .par files (from --files), 1 .tms-file from tmux attach" echo "### 3+3 .par files (from --files), 1 .tms-file from tmux attach"

View file

@ -12,6 +12,172 @@ par__10000_5_rpl_X 4
par__10000_5_rpl_X 4 par__10000_5_rpl_X 4
par__10000_5_rpl_X 3 par__10000_5_rpl_X 3
par__10000_5_rpl_X 2 par__10000_5_rpl_X 2
par__argfile_plus -- -a file +file ++file
par__argfile_plus parallel: Error: It is unclear whether you mean +./file or ./+file
par__argfile_plus -- -a file +./file ++file
par__argfile_plus parallel: Error: It is unclear whether you mean +./+file or ./++file
par__argfile_plus -- -a file ./+file ++file
par__argfile_plus parallel: Error: It is unclear whether you mean +./+file or ./++file
par__argfile_plus -- -a file +file +./+file
par__argfile_plus parallel: Error: It is unclear whether you mean +./file or ./+file
par__argfile_plus -- -a file +./file +./+file
par__argfile_plus 1 1 4
par__argfile_plus 2 2 5
par__argfile_plus 3 3 6
par__argfile_plus -- -a file ./+file +./+file
par__argfile_plus 1 4 4
par__argfile_plus 1 5 5
par__argfile_plus 1 6 6
par__argfile_plus 2 4 4
par__argfile_plus 2 5 5
par__argfile_plus 2 6 6
par__argfile_plus 3 4 4
par__argfile_plus 3 5 5
par__argfile_plus 3 6 6
par__argfile_plus -- -a file +file ./++file
par__argfile_plus parallel: Error: It is unclear whether you mean +./file or ./+file
par__argfile_plus -- -a file +./file ./++file
par__argfile_plus 1 1 7
par__argfile_plus 1 1 8
par__argfile_plus 1 1 9
par__argfile_plus 2 2 7
par__argfile_plus 2 2 8
par__argfile_plus 2 2 9
par__argfile_plus 3 3 7
par__argfile_plus 3 3 8
par__argfile_plus 3 3 9
par__argfile_plus -- -a file ./+file ./++file
par__argfile_plus 1 4 7
par__argfile_plus 1 4 8
par__argfile_plus 1 4 9
par__argfile_plus 1 5 7
par__argfile_plus 1 5 8
par__argfile_plus 1 5 9
par__argfile_plus 1 6 7
par__argfile_plus 1 6 8
par__argfile_plus 1 6 9
par__argfile_plus 2 4 7
par__argfile_plus 2 4 8
par__argfile_plus 2 4 9
par__argfile_plus 2 5 7
par__argfile_plus 2 5 8
par__argfile_plus 2 5 9
par__argfile_plus 2 6 7
par__argfile_plus 2 6 8
par__argfile_plus 2 6 9
par__argfile_plus 3 4 7
par__argfile_plus 3 4 8
par__argfile_plus 3 4 9
par__argfile_plus 3 5 7
par__argfile_plus 3 5 8
par__argfile_plus 3 5 9
par__argfile_plus 3 6 7
par__argfile_plus 3 6 8
par__argfile_plus 3 6 9
par__argfile_plus :::: file +file ++file
par__argfile_plus parallel: Error: It is unclear whether you mean +./file or ./+file
par__argfile_plus :::: file +./file ++file
par__argfile_plus parallel: Error: It is unclear whether you mean +./+file or ./++file
par__argfile_plus :::: file ./+file ++file
par__argfile_plus parallel: Error: It is unclear whether you mean +./+file or ./++file
par__argfile_plus :::: file +file +./+file
par__argfile_plus parallel: Error: It is unclear whether you mean +./file or ./+file
par__argfile_plus :::: file +./file +./+file
par__argfile_plus 1 1 4
par__argfile_plus 2 2 5
par__argfile_plus 3 3 6
par__argfile_plus :::: file ./+file +./+file
par__argfile_plus 1 4 4
par__argfile_plus 1 5 5
par__argfile_plus 1 6 6
par__argfile_plus 2 4 4
par__argfile_plus 2 5 5
par__argfile_plus 2 6 6
par__argfile_plus 3 4 4
par__argfile_plus 3 5 5
par__argfile_plus 3 6 6
par__argfile_plus :::: file +file ./++file
par__argfile_plus parallel: Error: It is unclear whether you mean +./file or ./+file
par__argfile_plus :::: file +./file ./++file
par__argfile_plus 1 1 7
par__argfile_plus 1 1 8
par__argfile_plus 1 1 9
par__argfile_plus 2 2 7
par__argfile_plus 2 2 8
par__argfile_plus 2 2 9
par__argfile_plus 3 3 7
par__argfile_plus 3 3 8
par__argfile_plus 3 3 9
par__argfile_plus :::: file ./+file ./++file
par__argfile_plus 1 4 7
par__argfile_plus 1 4 8
par__argfile_plus 1 4 9
par__argfile_plus 1 5 7
par__argfile_plus 1 5 8
par__argfile_plus 1 5 9
par__argfile_plus 1 6 7
par__argfile_plus 1 6 8
par__argfile_plus 1 6 9
par__argfile_plus 2 4 7
par__argfile_plus 2 4 8
par__argfile_plus 2 4 9
par__argfile_plus 2 5 7
par__argfile_plus 2 5 8
par__argfile_plus 2 5 9
par__argfile_plus 2 6 7
par__argfile_plus 2 6 8
par__argfile_plus 2 6 9
par__argfile_plus 3 4 7
par__argfile_plus 3 4 8
par__argfile_plus 3 4 9
par__argfile_plus 3 5 7
par__argfile_plus 3 5 8
par__argfile_plus 3 5 9
par__argfile_plus 3 6 7
par__argfile_plus 3 6 8
par__argfile_plus 3 6 9
par__argfile_plus -- -a ./file ./++file -
par__argfile_plus 1 7 10
par__argfile_plus 1 7 11
par__argfile_plus 1 7 12
par__argfile_plus 1 8 10
par__argfile_plus 1 8 11
par__argfile_plus 1 8 12
par__argfile_plus 1 9 10
par__argfile_plus 1 9 11
par__argfile_plus 1 9 12
par__argfile_plus 2 7 10
par__argfile_plus 2 7 11
par__argfile_plus 2 7 12
par__argfile_plus 2 8 10
par__argfile_plus 2 8 11
par__argfile_plus 2 8 12
par__argfile_plus 2 9 10
par__argfile_plus 2 9 11
par__argfile_plus 2 9 12
par__argfile_plus 3 7 10
par__argfile_plus 3 7 11
par__argfile_plus 3 7 12
par__argfile_plus 3 8 10
par__argfile_plus 3 8 11
par__argfile_plus 3 8 12
par__argfile_plus 3 9 10
par__argfile_plus 3 9 11
par__argfile_plus 3 9 12
par__argfile_plus -- -a ./file +./+file +-
par__argfile_plus 1 4 10
par__argfile_plus 2 5 11
par__argfile_plus 3 6 12
par__argfile_plus -- -a ./file +- ./+file
par__argfile_plus 1 10 4
par__argfile_plus 1 10 5
par__argfile_plus 1 10 6
par__argfile_plus 2 11 4
par__argfile_plus 2 11 5
par__argfile_plus 2 11 6
par__argfile_plus 3 12 4
par__argfile_plus 3 12 5
par__argfile_plus 3 12 6
par__parset_assoc_arr bash@lo parset into an assoc array par__parset_assoc_arr bash@lo parset into an assoc array
par__parset_assoc_arr bash@lo val 1 val 2 val 3 par__parset_assoc_arr bash@lo val 1 val 2 val 3
par__parset_assoc_arr bash@lo val 1 val 2 val 3 par__parset_assoc_arr bash@lo val 1 val 2 val 3

View file

@ -8,7 +8,6 @@
160d3159 9480cf5c a101512f 150b7ac0 206a65dc 86f2bb6b bdf1a2bc 96bc6d06 160d3159 9480cf5c a101512f 150b7ac0 206a65dc 86f2bb6b bdf1a2bc 96bc6d06
7f8237c2 0964b67f bccf8a93 332528fa 11e5ab43 2a6226a6 ceb197ab 7f03c061 7f8237c2 0964b67f bccf8a93 332528fa 11e5ab43 2a6226a6 ceb197ab 7f03c061
$ bash install.sh $ bash install.sh
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: ` fetch -o - http://pi.dk/3 ) > install.sh' /usr/bin/bash: -c: line 1: ` fetch -o - http://pi.dk/3 ) > install.sh'
parallel -k echo ::: A B C > abc-file parallel -k echo ::: A B C > abc-file
parallel -k echo ::: D E F > def-file parallel -k echo ::: D E F > def-file
@ -23,7 +22,6 @@ sleep .3
/usr/bin/bash: -c: line 3: syntax error: unexpected end of file /usr/bin/bash: -c: line 3: syntax error: unexpected end of file
sleep .3 sleep .3
perl -e 'for(1..10){print "$_\n"}') > num_%header perl -e 'for(1..10){print "$_\n"}') > num_%header
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: ` perl -e 'for(1..10){print "$_\n"}') > num_%header' /usr/bin/bash: -c: line 1: ` perl -e 'for(1..10){print "$_\n"}') > num_%header'
perl -e 'print "HHHHAAABBBCCC"' > fixedlen perl -e 'print "HHHHAAABBBCCC"' > fixedlen
parallel echo ::: A B C parallel echo ::: A B C
@ -351,7 +349,6 @@ foo
perl -e 'print "@ARGV\n"' perl -e 'print "@ARGV\n"'
[CTRL-D] [CTRL-D]
/usr/bin/bash: line 2: Warning:: command not found /usr/bin/bash: line 2: Warning:: command not found
/usr/bin/bash: -c: line 3: syntax error near unexpected token `('
/usr/bin/bash: -c: line 3: ` Warning: are doing (in which case: YOU ARE AWESOME!) or you forgot' /usr/bin/bash: -c: line 3: ` Warning: are doing (in which case: YOU ARE AWESOME!) or you forgot'
parallel --trim r echo pre-{}-post ::: ' A ' parallel --trim r echo pre-{}-post ::: ' A '
pre- A-post pre- A-post
@ -364,26 +361,6 @@ pre-A-post
=bash =bash
=ls =ls
parallel 'set a="{}"; if( { test -d "$a" } ) echo "$a is a dir"' ::: * parallel 'set a="{}"; if( { test -d "$a" } ) echo "$a is a dir"' ::: *
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: `set a="abc-file"; if( { test -d "$a" } ) echo "$a is a dir"'
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: `set a="abc0-file"; if( { test -d "$a" } ) echo "$a is a dir"'
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: `set a="abc_-file"; if( { test -d "$a" } ) echo "$a is a dir"'
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: `set a="def-file"; if( { test -d "$a" } ) echo "$a is a dir"'
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: `set a="fixedlen"; if( { test -d "$a" } ) echo "$a is a dir"'
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: `set a="num1000000"; if( { test -d "$a" } ) echo "$a is a dir"'
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: `set a="num30000"; if( { test -d "$a" } ) echo "$a is a dir"'
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: `set a="num8"; if( { test -d "$a" } ) echo "$a is a dir"'
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: `set a="outdir"; if( { test -d "$a" } ) echo "$a is a dir"'
/usr/bin/bash: -c: line 1: syntax error near unexpected token `)'
/usr/bin/bash: -c: line 1: `set a="tsv-file.tsv"; if( { test -d "$a" } ) echo "$a is a dir"'
parallel --tag echo foo-{} ::: A B C parallel --tag echo foo-{} ::: A B C
A foo-A A foo-A
B foo-B B foo-B
@ -644,21 +621,17 @@ run_on_grp1
run_on_grp2 run_on_grp2
echo This is input_file > input_file echo This is input_file > input_file
parallel -S $SERVER1 --transferfile {} cat ::: input_file parallel -S $SERVER1 --transferfile {} cat ::: input_file
This is input_file
echo This is input_file > input_file echo This is input_file > input_file
parallel -S $SERVER1 --transferfile {} --return {}.out \ parallel -S $SERVER1 --transferfile {} --return {}.out \
cat {} ">"{}.out ::: input_file cat {} ">"{}.out ::: input_file
cat input_file.out cat input_file.out
This is input_file
echo This is input_file > input_file echo This is input_file > input_file
parallel -S $SERVER1 --transferfile {} --return {}.out --cleanup \ parallel -S $SERVER1 --transferfile {} --return {}.out --cleanup \
cat {} ">"{}.out ::: input_file cat {} ">"{}.out ::: input_file
cat input_file.out cat input_file.out
This is input_file
echo This is input_file > input_file echo This is input_file > input_file
parallel -S $SERVER1 --trc {}.out cat {} ">"{}.out ::: input_file parallel -S $SERVER1 --trc {}.out cat {} ">"{}.out ::: input_file
cat input_file.out cat input_file.out
This is input_file
echo common data > common_file echo common data > common_file
parallel --basefile common_file -S $SERVER1 \ parallel --basefile common_file -S $SERVER1 \
cat common_file\; echo {} ::: foo cat common_file\; echo {} ::: foo
@ -1107,7 +1080,6 @@ Warning: unknown mime-type for "Arguments @ARGV\n" -- using "application/octet-s
Error: no such file "Arguments @ARGV\n" Error: no such file "Arguments @ARGV\n"
#!/usr/bin/parallel --shebang-wrap /usr/bin/python #!/usr/bin/parallel --shebang-wrap /usr/bin/python
print 'Arguments', str(sys.argv) print 'Arguments', str(sys.argv)
/usr/bin/bash: -c: line 4: syntax error near unexpected token `('
/usr/bin/bash: -c: line 4: ` print 'Arguments', str(sys.argv)' /usr/bin/bash: -c: line 4: ` print 'Arguments', str(sys.argv)'
#!/usr/bin/parallel --shebang-wrap /bin/bash #!/usr/bin/parallel --shebang-wrap /bin/bash
echo Arguments "$@" echo Arguments "$@"
@ -1121,11 +1093,9 @@ Arguments
#!/usr/bin/parallel --shebang-wrap /usr/bin/Rscript --vanilla --slave #!/usr/bin/parallel --shebang-wrap /usr/bin/Rscript --vanilla --slave
args <- commandArgs(trailingOnly = TRUE) args <- commandArgs(trailingOnly = TRUE)
print(paste("Arguments ",args)) print(paste("Arguments ",args))
/usr/bin/bash: -c: line 3: syntax error near unexpected token `('
/usr/bin/bash: -c: line 3: ` args <- commandArgs(trailingOnly = TRUE)' /usr/bin/bash: -c: line 3: ` args <- commandArgs(trailingOnly = TRUE)'
#!/usr/bin/parallel --shebang-wrap ARG={} /usr/bin/gnuplot #!/usr/bin/parallel --shebang-wrap ARG={} /usr/bin/gnuplot
print "Arguments ", system('echo $ARG') print "Arguments ", system('echo $ARG')
/usr/bin/bash: -c: line 3: syntax error near unexpected token `('
/usr/bin/bash: -c: line 3: ` print "Arguments ", system('echo $ARG')' /usr/bin/bash: -c: line 3: ` print "Arguments ", system('echo $ARG')'
#!/usr/bin/parallel --shebang-wrap /usr/bin/ruby #!/usr/bin/parallel --shebang-wrap /usr/bin/ruby
print "Arguments " print "Arguments "
@ -1140,7 +1110,6 @@ Error: no such file "Arguments "
printf (" %s", arg_list{i}); printf (" %s", arg_list{i});
endfor endfor
printf ("\n"); printf ("\n");
/usr/bin/bash: -c: line 3: syntax error near unexpected token `"Arguments"'
/usr/bin/bash: -c: line 3: ` printf ("Arguments");' /usr/bin/bash: -c: line 3: ` printf ("Arguments");'
#!/usr/bin/parallel --shebang-wrap /usr/bin/clisp #!/usr/bin/parallel --shebang-wrap /usr/bin/clisp
(format t "~&~S~&" 'Arguments) (format t "~&~S~&" 'Arguments)
@ -1158,12 +1127,10 @@ Error: no such file "Arguments "
?> ?>
Arguments Arguments
/usr/bin/bash: line 2: ?php: No such file or directory /usr/bin/bash: line 2: ?php: No such file or directory
/usr/bin/bash: -c: line 4: syntax error near unexpected token `array_slice'
/usr/bin/bash: -c: line 4: ` foreach(array_slice($argv,1) as $v)' /usr/bin/bash: -c: line 4: ` foreach(array_slice($argv,1) as $v)'
#!/usr/bin/parallel --shebang-wrap /usr/bin/node #!/usr/bin/parallel --shebang-wrap /usr/bin/node
var myArgs = process.argv.slice(2); var myArgs = process.argv.slice(2);
console.log('Arguments ', myArgs); console.log('Arguments ', myArgs);
/usr/bin/bash: -c: line 1: syntax error near unexpected token `('
/usr/bin/bash: -c: line 1: ` var myArgs = process.argv.slice(2);' /usr/bin/bash: -c: line 1: ` var myArgs = process.argv.slice(2);'
#!/usr/bin/parallel --shebang-wrap /usr/bin/lua #!/usr/bin/parallel --shebang-wrap /usr/bin/lua
io.write "Arguments" io.write "Arguments"
@ -1173,12 +1140,10 @@ Arguments
end end
print(") print(")
/usr/bin/bash: line 3: io.write: command not found /usr/bin/bash: line 3: io.write: command not found
/usr/bin/bash: -c: line 4: syntax error near unexpected token `='
/usr/bin/bash: -c: line 4: ` for a = 1, #arg do' /usr/bin/bash: -c: line 4: ` for a = 1, #arg do'
#!/usr/bin/parallel --shebang-wrap ARGV={} /usr/bin/csharp #!/usr/bin/parallel --shebang-wrap ARGV={} /usr/bin/csharp
var argv = Environment.GetEnvironmentVariable("ARGV"); var argv = Environment.GetEnvironmentVariable("ARGV");
print("Arguments "+argv); print("Arguments "+argv);
/usr/bin/bash: -c: line 3: syntax error near unexpected token `('
/usr/bin/bash: -c: line 3: ` var argv = Environment.GetEnvironmentVariable("ARGV");' /usr/bin/bash: -c: line 3: ` var argv = Environment.GetEnvironmentVariable("ARGV");'
sem 'sleep 1; echo The first finished' && sem 'sleep 1; echo The first finished' &&
echo The first is now running in the background && echo The first is now running in the background &&