From 327e2715650fc122f817de71f466d9bdfff03116 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sat, 22 Apr 2023 20:47:04 +0200 Subject: [PATCH] parallel: Fixed bug #64030: parallel --ll echo -n ::: foo --- NEWS | 9 ++ doc/release_new_version | 3 + src/env_parallel | 42 ++++---- src/env_parallel.ash | 2 +- src/env_parallel.bash | 2 +- src/env_parallel.dash | 2 +- src/env_parallel.ksh | 2 +- src/env_parallel.mksh | 2 +- src/env_parallel.pdksh | 2 +- src/env_parallel.pod | 32 +++--- src/parallel | 44 +++++---- testsuite/tests-to-run/parallel-centos3.sh | 3 + testsuite/tests-to-run/parallel-local-0.3s.sh | 19 +++- testsuite/tests-to-run/parallel-local-10s.sh | 4 - testsuite/wanted-results/parallel-local-0.3s | 6 ++ testsuite/wanted-results/parallel-local-10s | 37 ------- testsuite/wanted-results/parallel-local-300s | 1 - testsuite/wanted-results/parallel-tutorial | 97 ++++++++----------- 18 files changed, 144 insertions(+), 165 deletions(-) diff --git a/NEWS b/NEWS index 2aeeed12..0d6fdca9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +20230422 + +New in this release: + +* --jobs evaluates expression: +3*log(55)% = ncpu*1.12 + +* Bug fixes and man page updates. + + 20230322 New in this release: diff --git a/doc/release_new_version b/doc/release_new_version index e556a0b8..5a0fbe74 100644 --- a/doc/release_new_version +++ b/doc/release_new_version @@ -277,8 +277,11 @@ New in this release: News about GNU Parallel: +https://w3toppers.com/running-shell-script-in-parallel/ +https://aws.amazon.com/blogs/hpc/simulating-climate-risk-scenarios-for-the-amazon-rainforest/ https://bash-prompt.net/guides/parallell-bash/ https://medium.com/linuxstories/bash-parallel-command-execution-d4bd7c7cc1d6 +https://www.cfdengine.com/newsletter/142/ <<>> diff --git a/src/env_parallel b/src/env_parallel index 3aa7d7cd..83ed027b 100755 --- a/src/env_parallel +++ b/src/env_parallel @@ -83,8 +83,8 @@ env_parallel only works if it is a function. Do this and restart your shell: -bash: Put this in $HOME/.bashrc: . `which env_parallel.bash` - E.g. by doing: echo '. `which env_parallel.bash`' >> $HOME/.bashrc +bash: Put this in $HOME/.bashrc: . env_parallel.bash + E.g. by doing: echo '. env_parallel.bash' >> $HOME/.bashrc Supports: variables, aliases, functions, arrays fish: Put this in $HOME/.config/fish/config.fish: . (which env_parallel.fish) @@ -92,28 +92,28 @@ fish: Put this in $HOME/.config/fish/config.fish: . (which env_parallel.fish) echo '. (which env_parallel.fish)' >> $HOME/.config/fish/config.fish Supports: variables, aliases, functions, arrays -ksh: Put this in $HOME/.kshrc: source `which env_parallel.ksh` - E.g. by doing: echo 'source `which env_parallel.ksh`' >> $HOME/.kshrc +ksh: Put this in $HOME/.kshrc: source env_parallel.ksh + E.g. by doing: echo 'source env_parallel.ksh' >> $HOME/.kshrc Supports: variables, aliases, functions, arrays -mksh: Put this in $HOME/.mkshrc: source `which env_parallel.mksh` - E.g. by doing: echo 'source `which env_parallel.mksh`' >> $HOME/.mkshrc +mksh: Put this in $HOME/.mkshrc: source env_parallel.mksh + E.g. by doing: echo 'source env_parallel.mksh' >> $HOME/.mkshrc Supports: variables, aliases, functions, arrays -pdksh: Put this in $HOME/.profile: source `which env_parallel.pdksh` - E.g. by doing: echo '. `which env_parallel.pdksh`' >> $HOME/.profile +pdksh: Put this in $HOME/.profile: source env_parallel.pdksh + E.g. by doing: echo '. env_parallel.pdksh' >> $HOME/.profile Supports: variables, aliases, functions, arrays -zsh: Put this in $HOME/.zshrc: . `which env_parallel.zsh` - E.g. by doing: echo '. `which env_parallel.zsh`' >> $HOME/.zshenv +zsh: Put this in $HOME/.zshrc: . env_parallel.zsh + E.g. by doing: echo '. env_parallel.zsh' >> $HOME/.zshenv Supports: variables, functions, arrays -ash: Put this in $HOME/.profile: . `which env_parallel.ash` - E.g. by doing: echo '. `which env_parallel.ash`' >> $HOME/.profile +ash: Put this in $HOME/.profile: . env_parallel.ash + E.g. by doing: echo '. env_parallel.ash' >> $HOME/.profile Supports: variables, aliases -dash: Put this in $HOME/.profile: . `which env_parallel.dash` - E.g. by doing: echo '. `which env_parallel.dash`' >> $HOME/.profile +dash: Put this in $HOME/.profile: . env_parallel.dash + E.g. by doing: echo '. env_parallel.dash' >> $HOME/.profile Supports: variables, aliases csh: Put this in $HOME/.cshrc: source `which env_parallel.csh` @@ -130,13 +130,13 @@ To install in all shells run: In a script you need to run this before using env_parallel: -bash: . `which env_parallel.bash` -ksh: source `which env_parallel.ksh` -mksh: source `which env_parallel.mksh` -pdksh: source `which env_parallel.pdksh` -zsh: . `which env_parallel.zsh` -ash: . `which env_parallel.ash` -dash: . `which env_parallel.dash` +bash: . env_parallel.bash +ksh: source env_parallel.ksh +mksh: source env_parallel.mksh +pdksh: source env_parallel.pdksh +zsh: . env_parallel.zsh +ash: . env_parallel.ash +dash: . env_parallel.dash For details: see man env_parallel diff --git a/src/env_parallel.ash b/src/env_parallel.ash index fe27f84e..e3d459d5 100755 --- a/src/env_parallel.ash +++ b/src/env_parallel.ash @@ -2,7 +2,7 @@ # This file must be sourced in ash: # -# . `which env_parallel.ash` +# . env_parallel.ash # # after which 'env_parallel' works # diff --git a/src/env_parallel.bash b/src/env_parallel.bash index 5eaa3060..019fb36c 100755 --- a/src/env_parallel.bash +++ b/src/env_parallel.bash @@ -2,7 +2,7 @@ # This file must be sourced in bash: # -# source `which env_parallel.bash` +# source env_parallel.bash # # after which 'env_parallel' works # diff --git a/src/env_parallel.dash b/src/env_parallel.dash index 918cd89d..c2c7b904 100755 --- a/src/env_parallel.dash +++ b/src/env_parallel.dash @@ -2,7 +2,7 @@ # This file must be sourced in dash: # -# . `which env_parallel.dash` +# . env_parallel.dash # # after which 'env_parallel' works # diff --git a/src/env_parallel.ksh b/src/env_parallel.ksh index 51200422..975e6ecf 100755 --- a/src/env_parallel.ksh +++ b/src/env_parallel.ksh @@ -2,7 +2,7 @@ # This file must be sourced in ksh: # -# source `which env_parallel.ksh` +# source env_parallel.ksh # # after which 'env_parallel' works # diff --git a/src/env_parallel.mksh b/src/env_parallel.mksh index 08e0d6f9..b70cb1f4 100644 --- a/src/env_parallel.mksh +++ b/src/env_parallel.mksh @@ -2,7 +2,7 @@ # This file must be sourced in mksh: # -# source `which env_parallel.mksh` +# source env_parallel.mksh # # after which 'env_parallel' works # diff --git a/src/env_parallel.pdksh b/src/env_parallel.pdksh index 74df9111..28bf09de 100755 --- a/src/env_parallel.pdksh +++ b/src/env_parallel.pdksh @@ -2,7 +2,7 @@ # This file must be sourced in pdksh: # -# source `which env_parallel.pdksh` +# source env_parallel.pdksh # # after which 'env_parallel' works # diff --git a/src/env_parallel.pod b/src/env_parallel.pod index fc81f373..263a6717 100644 --- a/src/env_parallel.pod +++ b/src/env_parallel.pod @@ -147,11 +147,11 @@ You can run multiple B<--session> inside each other: Put this in $HOME/.profile: - . `which env_parallel.ash` + . env_parallel.ash E.g. by doing: - echo '. `which env_parallel.ash`' >> $HOME/.profile + echo '. env_parallel.ash' >> $HOME/.profile =head3 Supported use @@ -201,11 +201,11 @@ Arrays are not supported by Ash. Put this in $HOME/.bashrc: - . `which env_parallel.bash` + . env_parallel.bash E.g. by doing: - echo '. `which env_parallel.bash`' >> $HOME/.bashrc + echo '. env_parallel.bash' >> $HOME/.bashrc =head3 Supported use @@ -328,11 +328,11 @@ Not supported by B. Put this in $HOME/.profile: - . `which env_parallel.dash` + . env_parallel.dash E.g. by doing: - echo '. `which env_parallel.dash`' >> $HOME/.profile + echo '. env_parallel.dash' >> $HOME/.profile =head3 Supported use @@ -443,11 +443,11 @@ B<--session> is supported. Put this in $HOME/.kshrc: - source `which env_parallel.ksh` + source env_parallel.ksh E.g. by doing: - echo 'source `which env_parallel.ksh`' >> $HOME/.kshrc + echo 'source env_parallel.ksh' >> $HOME/.kshrc =head3 Supported use @@ -507,11 +507,11 @@ B<--session> is supported. Put this in $HOME/.mkshrc: - source `which env_parallel.mksh` + source env_parallel.mksh E.g. by doing: - echo 'source `which env_parallel.mksh`' >> $HOME/.mkshrc + echo 'source env_parallel.mksh' >> $HOME/.mkshrc =head3 Supported use @@ -571,11 +571,11 @@ B<--session> is supported. Put this in $HOME/.profile: - source `which env_parallel.pdksh` + source env_parallel.pdksh E.g. by doing: - echo 'source `which env_parallel.pdksh`' >> $HOME/.profile + echo 'source env_parallel.pdksh' >> $HOME/.profile =head3 Supported use @@ -628,11 +628,11 @@ B<--session> is supported. Put this in $HOME/.profile: - . `which env_parallel.sh` + . env_parallel.sh E.g. by doing: - echo '. `which env_parallel.sh`' >> $HOME/.profile + echo '. env_parallel.sh' >> $HOME/.profile =head3 Supported use @@ -730,11 +730,11 @@ Not supported by B. Put this in $HOME/.zshrc: - . `which env_parallel.zsh` + . env_parallel.zsh E.g. by doing: - echo '. `which env_parallel.zsh`' >> $HOME/.zshenv + echo '. env_parallel.zsh' >> $HOME/.zshenv =head3 Supported use diff --git a/src/parallel b/src/parallel index 8eec6d73..37d24b42 100755 --- a/src/parallel +++ b/src/parallel @@ -3143,6 +3143,8 @@ sub open_joblog() { # Do not log if --sqlworker if($opt::resume || $opt::resume_failed || $opt::retry_failed) { if(open(my $joblog_fh, "<", $opt::joblog)) { + # Enable utf8 if possible + eval q{ binmode $joblog_fh, "encoding(utf8)"; }; # Read the joblog # Override $/ with \n because -d might be set local $/ = "\n"; @@ -11443,7 +11445,7 @@ sub print_files($) { } return $str; } - + sub print_latest_line($) { my $self = shift; my $out_fh = shift; @@ -11651,26 +11653,28 @@ sub print_files($) { if($Global::files or ($opt::results and not $Global::csvsep)) { $self->add_returnsize(-s $self->fh($fdno,"name")); } else { - # If the job is dead: print the remaining partial line - # read remaining - my $halfline_ref = $self->{'halfline'}{$fdno}; - if(grep /./, @$halfline_ref) { - my $returnsize = 0; - for(@{$self->{'halfline'}{$fdno}}) { - $returnsize += length $_; + if(not $opt::latestline) { + # If the job is dead: print the remaining partial line + # read remaining (already done for $opt::latestline) + my $halfline_ref = $self->{'halfline'}{$fdno}; + if(grep /./, @$halfline_ref) { + my $returnsize = 0; + for(@{$self->{'halfline'}{$fdno}}) { + $returnsize += length $_; + } + $self->add_returnsize($returnsize); + if($opt::tag or defined $opt::tagstring) { + # Prepend $tag the the remaining half line + unshift @$halfline_ref, $self->tag(); + } + # Print the partial line (halfline) + print $out_fh @{$self->{'halfline'}{$fdno}}; + # Buffer in memory for SQL and CSV-output + if($Global::membuffer) { + push(@{$self->{'output'}{$fdno}}, @$halfline_ref); + } + @$halfline_ref = (); } - $self->add_returnsize($returnsize); - if($opt::tag or defined $opt::tagstring) { - # Prepend $tag the the remaining half line - unshift @$halfline_ref, $self->tag(); - } - # Print the partial line (halfline) - print $out_fh @{$self->{'halfline'}{$fdno}}; - # Buffer in memory for SQL and CSV-output - if($Global::membuffer) { - push(@{$self->{'output'}{$fdno}}, @$halfline_ref); - } - @$halfline_ref = (); } } if($self->fh($fdno,"rpid") and diff --git a/testsuite/tests-to-run/parallel-centos3.sh b/testsuite/tests-to-run/parallel-centos3.sh index 7b535ef3..70c8bfe8 100644 --- a/testsuite/tests-to-run/parallel-centos3.sh +++ b/testsuite/tests-to-run/parallel-centos3.sh @@ -29,6 +29,9 @@ export SSHLOGIN2=$SSHUSER2@$SERVER2 start_centos3() { stdout ping -w 1 -c 1 centos3 >/dev/null || ( # Vagrant does not set the IP addr + # cd to the centos3 dir with the Vagrantfile + # Try different "cd"s as the script may be started from another dir + cd $testsuitedir/vagrant/tange/centos3/ 2>/dev/null cd testsuite/vagrant/tange/centos3/ 2>/dev/null cd vagrant/tange/centos3/ 2>/dev/null cd ../vagrant/tange/centos3/ 2>/dev/null diff --git a/testsuite/tests-to-run/parallel-local-0.3s.sh b/testsuite/tests-to-run/parallel-local-0.3s.sh index 3db31f1b..fb7e2085 100644 --- a/testsuite/tests-to-run/parallel-local-0.3s.sh +++ b/testsuite/tests-to-run/parallel-local-0.3s.sh @@ -16,6 +16,15 @@ export -f stdsort # Test amount of parallelization # parallel --shuf --jl /tmp/myjl -j1 'export JOBS={1};'bash tests-to-run/parallel-local-0.3s.sh ::: {1..16} ::: {1..5} +par_ll_no_newline() { + echo 'bug #64030: parallel --ll echo -n ::: foo' + parallel --ll echo -n ::: two lines | sort + parallel --ll echo -n '>&2' ::: two lines | sort + parallel --linebuffer 'echo -n last {}' ::: line + stdout parallel --linebuffer 'echo -n last {} >&2' ::: line + echo +} + par_ll_long_followed_by_short() { parallel --ll 'echo A very long line;sleep 0.2;echo' ::: OK | puniq } @@ -70,7 +79,7 @@ par_ctagstring() { par_env_parallel_pipefail() { cat <<'EOF' | bash echo "### test env_parallel with pipefail + inherit_errexit" - . $(which env_parallel.bash) + . env_parallel.bash env_parallel --session set -Eeuo pipefail shopt -s inherit_errexit @@ -210,7 +219,7 @@ par_do_not_export_PARALLEL_ENV() { echo Should give 60k and not overflow PARALLEL_ENV="$PARALLEL_ENV" parallel echo '{=$_="\""x$_=}' ::: 60000 | wc } - . `which env_parallel.bash` + . env_parallel.bash # Make PARALLEL_ENV as big as possible PARALLEL_ENV="a='$(seq 100000 | head -c $((139000-$(set|wc -c) )) )'" env_parallel doit ::: 1 @@ -587,7 +596,7 @@ par_expansion_in_colsep() { } par_extglob() { - bash -O extglob -c '. `which env_parallel.bash`; + bash -O extglob -c '. env_parallel.bash; _longopt () { case "$prev" in --+([-a-z0-9_])) @@ -674,7 +683,7 @@ par_tee() { } par_parset_tee() { - . $(which env_parallel.bash) + . env_parallel.bash export PARALLEL='-k --tee --pipe --tag' parset a,b 'grep {}|wc' ::: 1 5 < <(seq 10000) echo $a @@ -952,7 +961,7 @@ par_empty_command() { echo 'bug #54647: parset ignores empty lines' # really due to this. Should give an empty line due to -v: parallel -v :::: <(echo) - . `which env_parallel.bash` + . env_parallel.bash parset a,b,c :::: <(echo echo A; echo; echo echo C) echo Empty: $b parset a,b,c :::: <(echo echo A; echo echo B; echo echo C) diff --git a/testsuite/tests-to-run/parallel-local-10s.sh b/testsuite/tests-to-run/parallel-local-10s.sh index fbf2e3c6..64318030 100644 --- a/testsuite/tests-to-run/parallel-local-10s.sh +++ b/testsuite/tests-to-run/parallel-local-10s.sh @@ -761,10 +761,6 @@ par_tmp_full() { } par_jobs_file() { - echo '### Test of -j filename - non-existent file' - stdout parallel -j no_such_file echo ::: 1 | - perl -ne '/Tange, O.|Zenodo./ or print' - echo '### Test of -j filename' echo 3 >/tmp/jobs_to_run1 parallel -j /tmp/jobs_to_run1 -v sleep {} ::: 10 8 6 5 4 diff --git a/testsuite/wanted-results/parallel-local-0.3s b/testsuite/wanted-results/parallel-local-0.3s index 9f20e8b3..feec32b0 100644 --- a/testsuite/wanted-results/parallel-local-0.3s +++ b/testsuite/wanted-results/parallel-local-0.3s @@ -339,6 +339,12 @@ par_link_files_as_only_arg 3 3 3 par_ll_long_followed_by_short par_ll_long_followed_by_short A very long line par_ll_long_followed_by_short  par_ll_long_followed_by_short A very long line par_ll_long_followed_by_short  par_ll_long_followed_by_short OK +par_ll_no_newline bug #64030: parallel --ll echo -n ::: foo +par_ll_no_newline par_ll_no_newline lines +par_ll_no_newline par_ll_no_newline two +par_ll_no_newline par_ll_no_newline lines +par_ll_no_newline par_ll_no_newline two +par_ll_no_newline last linelast line par_locale_quoting ### quoting in different locales par_locale_quoting £`/tmp/test£` par_locale_quoting $LC_ALL £`/tmp/test£` diff --git a/testsuite/wanted-results/parallel-local-10s b/testsuite/wanted-results/parallel-local-10s index 10416791..c2692840 100644 --- a/testsuite/wanted-results/parallel-local-10s +++ b/testsuite/wanted-results/parallel-local-10s @@ -314,43 +314,6 @@ par_fifo_under_csh 1 par_fifo_under_csh 868832 par_fifo_under_csh 1 par_fifo_under_csh exit 22 -par_jobs_file ### Test of -j filename - non-existent file -par_jobs_file parallel: Error: Parsing of --jobs/-j/--max-procs/-P failed. -par_jobs_file Usage: -par_jobs_file -par_jobs_file parallel [options] [command [arguments]] < list_of_arguments -par_jobs_file parallel [options] [command [arguments]] (::: arguments|:::: argfile(s))... -par_jobs_file cat ... | parallel --pipe [options] [command [arguments]] -par_jobs_file -par_jobs_file -j n Run n jobs in parallel -par_jobs_file -k Keep same order -par_jobs_file -X Multiple arguments with context replace -par_jobs_file --colsep regexp Split input on regexp for positional replacements -par_jobs_file {} {.} {/} {/.} {#} {%} {= perl code =} Replacement strings -par_jobs_file {3} {3.} {3/} {3/.} {=3 perl code =} Positional replacement strings -par_jobs_file With --plus: {} = {+/}/{/} = {.}.{+.} = {+/}/{/.}.{+.} = {..}.{+..} = -par_jobs_file {+/}/{/..}.{+..} = {...}.{+...} = {+/}/{/...}.{+...} -par_jobs_file -par_jobs_file -S sshlogin Example: foo@server.example.com -par_jobs_file --slf .. Use ~/.parallel/sshloginfile as the list of sshlogins -par_jobs_file --trc {}.bar Shorthand for --transfer --return {}.bar --cleanup -par_jobs_file --onall Run the given command with argument on all sshlogins -par_jobs_file --nonall Run the given command with no arguments on all sshlogins -par_jobs_file -par_jobs_file --pipe Split stdin (standard input) to multiple jobs. -par_jobs_file --recend str Record end separator for --pipe. -par_jobs_file --recstart str Record start separator for --pipe. -par_jobs_file -par_jobs_file GNU Parallel can do much more. See 'man parallel' for details -par_jobs_file -par_jobs_file Academic tradition requires you to cite works you base your article on. -par_jobs_file If you use programs that use GNU Parallel to process data for an article in a -par_jobs_file scientific publication, please cite: -par_jobs_file -par_jobs_file -par_jobs_file This helps funding further development; AND IT WON'T COST YOU A CENT. -par_jobs_file If you pay 10000 EUR you should feel free to use GNU Parallel without citing. -par_jobs_file par_jobs_file ### Test of -j filename par_jobs_file sleep 6 par_jobs_file sleep 8 diff --git a/testsuite/wanted-results/parallel-local-300s b/testsuite/wanted-results/parallel-local-300s index 4cb9fae9..dedd8e34 100644 --- a/testsuite/wanted-results/parallel-local-300s +++ b/testsuite/wanted-results/parallel-local-300s @@ -1,7 +1,6 @@ par_compare_exit_codes ### compare the exit codes par_compare_exit_codes directly from shells, shells called from parallel, par_compare_exit_codes killed with different signals -par_compare_exit_codes par_compare_exit_codes sig=joblog_sig shell=parallel=joblog par_compare_exit_codes par_compare_exit_codes par_compare_exit_codes csh sig 2=0 130=1=1 diff --git a/testsuite/wanted-results/parallel-tutorial b/testsuite/wanted-results/parallel-tutorial index 0ea19bcf..e53500cb 100644 --- a/testsuite/wanted-results/parallel-tutorial +++ b/testsuite/wanted-results/parallel-tutorial @@ -149,8 +149,6 @@ num128 num30000 num8 outdir -tmsFPAdA -tmsNGdem tsv-file.tsv foo /TMP @@ -389,16 +387,6 @@ pre-A-post /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="tempfile"; 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="tempfile"; 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="tempfile"; 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="tmsFPAdA"; 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="tmsNGdem"; 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 A foo-A @@ -612,7 +600,6 @@ parallel: Starting no more jobs. Waiting for 1 jobs to finish. parallel -j2 --halt soon,fail=20% echo {}\; exit {} \ ::: 0 1 2 3 4 5 6 7 8 9 9 -parallel: Starting no more jobs. Waiting for 1 jobs to finish. parallel -j2 --halt now,success=1 echo {}\; exit {} ::: 1 2 3 0 4 5 6 9 parallel: This job succeeded: @@ -731,30 +718,30 @@ Unknown option: ::: Unknown option: green env_parallel only works if it is a function. Do this and restart your shell: -bash: Put this in $HOME/.bashrc: . `which env_parallel.bash` - E.g. by doing: echo '. `which env_parallel.bash`' >> $HOME/.bashrc +bash: Put this in $HOME/.bashrc: . env_parallel.bash + E.g. by doing: echo '. env_parallel.bash' >> $HOME/.bashrc Supports: variables, aliases, functions, arrays fish: Put this in $HOME/.config/fish/config.fish: . (which env_parallel.fish) E.g. by doing: echo '. (which env_parallel.fish)' >> $HOME/.config/fish/config.fish Supports: variables, aliases, functions, arrays -ksh: Put this in $HOME/.kshrc: source `which env_parallel.ksh` - E.g. by doing: echo 'source `which env_parallel.ksh`' >> $HOME/.kshrc +ksh: Put this in $HOME/.kshrc: source env_parallel.ksh + E.g. by doing: echo 'source env_parallel.ksh' >> $HOME/.kshrc Supports: variables, aliases, functions, arrays -mksh: Put this in $HOME/.mkshrc: source `which env_parallel.mksh` - E.g. by doing: echo 'source `which env_parallel.mksh`' >> $HOME/.mkshrc +mksh: Put this in $HOME/.mkshrc: source env_parallel.mksh + E.g. by doing: echo 'source env_parallel.mksh' >> $HOME/.mkshrc Supports: variables, aliases, functions, arrays -pdksh: Put this in $HOME/.profile: source `which env_parallel.pdksh` - E.g. by doing: echo '. `which env_parallel.pdksh`' >> $HOME/.profile +pdksh: Put this in $HOME/.profile: source env_parallel.pdksh + E.g. by doing: echo '. env_parallel.pdksh' >> $HOME/.profile Supports: variables, aliases, functions, arrays -zsh: Put this in $HOME/.zshrc: . `which env_parallel.zsh` - E.g. by doing: echo '. `which env_parallel.zsh`' >> $HOME/.zshenv +zsh: Put this in $HOME/.zshrc: . env_parallel.zsh + E.g. by doing: echo '. env_parallel.zsh' >> $HOME/.zshenv Supports: variables, functions, arrays -ash: Put this in $HOME/.profile: . `which env_parallel.ash` - E.g. by doing: echo '. `which env_parallel.ash`' >> $HOME/.profile +ash: Put this in $HOME/.profile: . env_parallel.ash + E.g. by doing: echo '. env_parallel.ash' >> $HOME/.profile Supports: variables, aliases -dash: Put this in $HOME/.profile: . `which env_parallel.dash` - E.g. by doing: echo '. `which env_parallel.dash`' >> $HOME/.profile +dash: Put this in $HOME/.profile: . env_parallel.dash + E.g. by doing: echo '. env_parallel.dash' >> $HOME/.profile Supports: variables, aliases csh: Put this in $HOME/.cshrc: source `which env_parallel.csh` E.g. by doing: echo 'source `which env_parallel.csh`' >> $HOME/.cshrc @@ -765,13 +752,13 @@ tcsh: Put this in $HOME/.tcshrc: source `which env_parallel.tcsh` To install in all shells run: env_parallel --install In a script you need to run this before using env_parallel: -bash: . `which env_parallel.bash` -ksh: source `which env_parallel.ksh` -mksh: source `which env_parallel.mksh` -pdksh: source `which env_parallel.pdksh` -zsh: . `which env_parallel.zsh` -ash: . `which env_parallel.ash` -dash: . `which env_parallel.dash` +bash: . env_parallel.bash +ksh: source env_parallel.ksh +mksh: source env_parallel.mksh +pdksh: source env_parallel.pdksh +zsh: . env_parallel.zsh +ash: . env_parallel.ash +dash: . env_parallel.dash For details: see man env_parallel MYVAR='foo bar' export MYVAR @@ -819,30 +806,30 @@ Unknown option: ::: Unknown option: bar env_parallel only works if it is a function. Do this and restart your shell: -bash: Put this in $HOME/.bashrc: . `which env_parallel.bash` - E.g. by doing: echo '. `which env_parallel.bash`' >> $HOME/.bashrc +bash: Put this in $HOME/.bashrc: . env_parallel.bash + E.g. by doing: echo '. env_parallel.bash' >> $HOME/.bashrc Supports: variables, aliases, functions, arrays fish: Put this in $HOME/.config/fish/config.fish: . (which env_parallel.fish) E.g. by doing: echo '. (which env_parallel.fish)' >> $HOME/.config/fish/config.fish Supports: variables, aliases, functions, arrays -ksh: Put this in $HOME/.kshrc: source `which env_parallel.ksh` - E.g. by doing: echo 'source `which env_parallel.ksh`' >> $HOME/.kshrc +ksh: Put this in $HOME/.kshrc: source env_parallel.ksh + E.g. by doing: echo 'source env_parallel.ksh' >> $HOME/.kshrc Supports: variables, aliases, functions, arrays -mksh: Put this in $HOME/.mkshrc: source `which env_parallel.mksh` - E.g. by doing: echo 'source `which env_parallel.mksh`' >> $HOME/.mkshrc +mksh: Put this in $HOME/.mkshrc: source env_parallel.mksh + E.g. by doing: echo 'source env_parallel.mksh' >> $HOME/.mkshrc Supports: variables, aliases, functions, arrays -pdksh: Put this in $HOME/.profile: source `which env_parallel.pdksh` - E.g. by doing: echo '. `which env_parallel.pdksh`' >> $HOME/.profile +pdksh: Put this in $HOME/.profile: source env_parallel.pdksh + E.g. by doing: echo '. env_parallel.pdksh' >> $HOME/.profile Supports: variables, aliases, functions, arrays -zsh: Put this in $HOME/.zshrc: . `which env_parallel.zsh` - E.g. by doing: echo '. `which env_parallel.zsh`' >> $HOME/.zshenv +zsh: Put this in $HOME/.zshrc: . env_parallel.zsh + E.g. by doing: echo '. env_parallel.zsh' >> $HOME/.zshenv Supports: variables, functions, arrays -ash: Put this in $HOME/.profile: . `which env_parallel.ash` - E.g. by doing: echo '. `which env_parallel.ash`' >> $HOME/.profile +ash: Put this in $HOME/.profile: . env_parallel.ash + E.g. by doing: echo '. env_parallel.ash' >> $HOME/.profile Supports: variables, aliases -dash: Put this in $HOME/.profile: . `which env_parallel.dash` - E.g. by doing: echo '. `which env_parallel.dash`' >> $HOME/.profile +dash: Put this in $HOME/.profile: . env_parallel.dash + E.g. by doing: echo '. env_parallel.dash' >> $HOME/.profile Supports: variables, aliases csh: Put this in $HOME/.cshrc: source `which env_parallel.csh` E.g. by doing: echo 'source `which env_parallel.csh`' >> $HOME/.cshrc @@ -853,13 +840,13 @@ tcsh: Put this in $HOME/.tcshrc: source `which env_parallel.tcsh` To install in all shells run: env_parallel --install In a script you need to run this before using env_parallel: -bash: . `which env_parallel.bash` -ksh: source `which env_parallel.ksh` -mksh: source `which env_parallel.mksh` -pdksh: source `which env_parallel.pdksh` -zsh: . `which env_parallel.zsh` -ash: . `which env_parallel.ash` -dash: . `which env_parallel.dash` +bash: . env_parallel.bash +ksh: source env_parallel.ksh +mksh: source env_parallel.mksh +pdksh: source env_parallel.pdksh +zsh: . env_parallel.zsh +ash: . env_parallel.ash +dash: . env_parallel.dash For details: see man env_parallel parallel -vv --pipepart --block 1M wc :::: num30000 32767?32767:$left)){$left-=$read;syswrite(STDOUT,$buf);}}' 0 0 0 168894 |(wc)