parallel: Fixed --shellquote in csh. Passes testsuite.

testsuite: Test --memfree blocks for 1TB.
testsuite: Test transfer of (assoc) arrays.
testsuite: Test that the remote perl-wrapper works.
This commit is contained in:
Ole Tange 2015-08-22 08:59:21 +02:00
parent 5b51b19bb1
commit 3e5393b1c0
10 changed files with 208 additions and 108 deletions

View file

@ -240,6 +240,8 @@ New in this release:
* SpeedSeq: ultra-fast personal genome analysis and interpretation http://www.nature.com/nmeth/journal/vaop/ncurrent/full/nmeth.3505.html * SpeedSeq: ultra-fast personal genome analysis and interpretation http://www.nature.com/nmeth/journal/vaop/ncurrent/full/nmeth.3505.html
* GNU Parallel is used in elPrep: https://github.com/ExaScience/elprep
* Who actually reads the code? http://www.fsf.org/blogs/community/who-actually-reads-the-code * Who actually reads the code? http://www.fsf.org/blogs/community/who-actually-reads-the-code
* Introduction to GNU Parallel http://erictleung.com/2015/08/06/intro-to-gnu-parallel/ * Introduction to GNU Parallel http://erictleung.com/2015/08/06/intro-to-gnu-parallel/

View file

@ -4191,20 +4191,28 @@ sub memfree_recompute {
# Buffers: 19876 kB # Buffers: 19876 kB
# Cached: 431192 kB # Cached: 431192 kB
# SwapCached: 0 kB # SwapCached: 0 kB
"linux" => q{ print 1024 * qx{ awk '/^((Swap)?Cached|MemFree|Buffers):/ { sum += \$2} END { print sum }' /proc/meminfo } }, "linux" =>
q[ print 1024 * qx{ ].
q[ awk '/^((Swap)?Cached|MemFree|Buffers):/ ].
q[ { sum += \$2} END { print sum }' ].
q[ /proc/meminfo } ],
# $ vmstat 1 1 # $ vmstat 1 1
# procs memory page faults cpu # procs memory page faults cpu
# r b w avm free re at pi po fr de sr in sy cs us sy id # r b w avm free re at pi po fr de sr in sy cs us sy id
# 1 0 0 242793 389737 5 1 0 0 0 0 0 107 978 60 1 1 99 # 1 0 0 242793 389737 5 1 0 0 0 0 0 107 978 60 1 1 99
"hpux" => q{ print (((reverse `vmstat 1 1`)[0] =~ /(?:\d+\D+){4}(\d+)/)[0]*1024) }, "hpux" =>
q[ print (((reverse `vmstat 1 1`)[0] ].
q[ =~ /(?:\d+\D+){4}(\d+)/)[0]*1024) ],
# $ vmstat 1 2 # $ vmstat 1 2
# kthr memory page disk faults cpu # kthr memory page disk faults cpu
# r b w swap free re mf pi po fr de sr s3 s4 -- -- in sy cs us sy id # r b w swap free re mf pi po fr de sr s3 s4 -- -- in sy cs us sy id
# 0 0 0 6496720 5170320 68 260 8 2 1 0 0 -0 3 0 0 309 1371 255 1 2 97 # 0 0 0 6496720 5170320 68 260 8 2 1 0 0 -0 3 0 0 309 1371 255 1 2 97
# 0 0 0 6434088 5072656 7 15 8 0 0 0 0 0 261 0 0 1889 1899 3222 0 8 92 # 0 0 0 6434088 5072656 7 15 8 0 0 0 0 0 261 0 0 1889 1899 3222 0 8 92
# #
# The last free is really free # The second free value is correct
"solaris" => q{ print (((reverse `vmstat 1 2`)[0] =~ /(?:\d+\D+){4}(\d+)/)[0]*1024) }, "solaris" =>
q[ print (((reverse `vmstat 1 2`)[0] ].
q[ =~ /(?:\d+\D+){4}(\d+)/)[0]*1024) ],
"freebsd" => q{ "freebsd" => q{
for(qx{/sbin/sysctl -a}) { for(qx{/sbin/sysctl -a}) {
if (/^([^:]+):\s+(.+)\s*$/s) { if (/^([^:]+):\s+(.+)\s*$/s) {
@ -6402,9 +6410,9 @@ sub wrapped {
if(not defined $self->{'wrapped'}) { if(not defined $self->{'wrapped'}) {
my $command = $self->replaced(); my $command = $self->replaced();
if($opt::shellquote) { if($opt::shellquote) {
# Prepend echo # Prepend \echo (echo no-\ is wrong in csh)
# and quote twice # and quote twice
$command = "echo " . $command = "\\echo " .
::shell_quote_scalar(::shell_quote_scalar($command)); ::shell_quote_scalar(::shell_quote_scalar($command));
} }
if($opt::cat) { if($opt::cat) {
@ -6576,7 +6584,7 @@ sub sshlogin_wrap {
unless($pid) { unless($pid) {
# Make own process group to be able to kill HUP it later # Make own process group to be able to kill HUP it later
setpgrp; setpgrp;
setpriority(0,0,$nice); eval { setpriority(0,0,$nice) };
exec $shell, "-c", ($bashfunc."@ARGV"); exec $shell, "-c", ($bashfunc."@ARGV");
die "exec: $!\n"; die "exec: $!\n";
} }
@ -7020,7 +7028,8 @@ sub start {
open ERR, '>&', $stderr_fh or ::die_bug("Can't dup STDERR: $!"); open ERR, '>&', $stderr_fh or ::die_bug("Can't dup STDERR: $!");
my $pid; my $pid;
my @setpgrp_wrap = ('perl','-e',"setpgrp\;setpriority\(0,0,$opt::nice\)\;exec '$Global::shell', '-c', \@ARGV"); my @setpgrp_wrap = ('perl','-e',
"setpgrp\;eval\{setpriority\(0,0,$opt::nice\)\}\;exec '$Global::shell', '-c', \@ARGV");
# The eval is needed to catch exception from open3 # The eval is needed to catch exception from open3
eval { eval {
$pid = ::open3($stdin_fh, ">&OUT", ">&ERR", @setpgrp_wrap, $command) $pid = ::open3($stdin_fh, ">&OUT", ">&ERR", @setpgrp_wrap, $command)
@ -7102,7 +7111,8 @@ sub start {
open ERR, '>&', $stderr_fh or ::die_bug("Can't dup STDERR: $!"); open ERR, '>&', $stderr_fh or ::die_bug("Can't dup STDERR: $!");
*IN = *STDIN; *IN = *STDIN;
# The eval is needed to catch exception from open3 # The eval is needed to catch exception from open3
my @setpgrp_wrap = ('perl','-e',"setpgrp\;setpriority\(0,0,$opt::nice\)\;exec '$Global::shell', '-c', \@ARGV"); my @setpgrp_wrap = ('perl','-e',
"setpgrp\;eval\{setpriority\(0,0,$opt::nice\)\}\;exec '$Global::shell', '-c', \@ARGV");
eval { eval {
$pid = ::open3("<&IN", ">&OUT", ">&ERR", @setpgrp_wrap, $command) $pid = ::open3("<&IN", ">&OUT", ">&ERR", @setpgrp_wrap, $command)
|| ::die_bug("open3-<IN"); || ::die_bug("open3-<IN");

View file

@ -4,4 +4,10 @@
# Each should be taking 10-30s and be possible to run in parallel # Each should be taking 10-30s and be possible to run in parallel
# I.e.: No race conditions, no logins # I.e.: No race conditions, no logins
cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -vj0 -k --joblog /tmp/jl-`basename $0` -L1 cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -vj0 -k --joblog /tmp/jl-`basename $0` -L1
echo '### test memfree'
parallel --memfree 1k echo Free mem: ::: 1k
stdout parallel --timeout 3 --argsep II parallel --memfree 1t echo Free mem: ::: II 1t
echo '**'
EOF EOF

View file

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
unset run_test
# SSH only allowed to localhost/lo # SSH only allowed to localhost/lo
# --retries if ssh dies # --retries if ssh dies
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | parallel -vj1 --retries 2 -k --joblog /tmp/jl-`basename $0` -L1 cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | parallel -vj1 --retries 2 -k --joblog /tmp/jl-`basename $0` -L1
@ -27,6 +29,22 @@ echo 'compared to parallel - no transfer non-exported var'
var=nonexported parallel -S parallel@lo echo '$var' ::: variable var=nonexported parallel -S parallel@lo echo '$var' ::: variable
echo '### zsh' echo '### zsh'
echo 'env in zsh'
echo 'Normal variable export'
export B=\';
PARALLEL_SHELL=/usr/bin/zsh parallel --env B echo '$B' ::: a
echo 'Function export as variable'
export myfuncvar="() { echo myfuncvar \$*; }";
PARALLEL_SHELL=/usr/bin/zsh parallel --env myfuncvar myfuncvar ::: a
echo 'Function export as function'
myfunc() { echo myfunc $*; };
export -f myfunc;
PARALLEL_SHELL=/usr/bin/zsh parallel --env myfunc myfunc ::: a
ssh zsh@lo 'fun="() { echo function from zsh to zsh \$*; }"; ssh zsh@lo 'fun="() { echo function from zsh to zsh \$*; }";
export fun; export fun;
parallel --env fun fun ::: OK' parallel --env fun fun ::: OK'
@ -49,8 +67,8 @@ echo '### csh2'
parallel --env A,B,C -k echo \$\{\}\|wc ::: A B C' parallel --env A,B,C -k echo \$\{\}\|wc ::: A B C'
echo '### Test tmux works on different shells' echo '### Test tmux works on different shells'
parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux echo ::: 1 2 3 4; echo $? (stdout parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux echo ::: 1 2 3 4; echo $?) | grep -v 'See output';
parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux false ::: 1 2 3 4; echo $? (stdout parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux false ::: 1 2 3 4; echo $?) | grep -v 'See output';
export PARTMUX='parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux '; export PARTMUX='parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux ';
stdout ssh zsh@lo "$PARTMUX" 'true ::: 1 2 3 4; echo $status' | grep -v 'See output'; stdout ssh zsh@lo "$PARTMUX" 'true ::: 1 2 3 4; echo $status' | grep -v 'See output';
@ -93,16 +111,22 @@ echo
echo Test env_parallel: echo Test env_parallel:
echo + for each shell echo + for each shell
echo + remote, locally echo + remote, locally
echo + variables, variables with funky content, arrays, functions, aliases echo + variables, variables with funky content, arrays, assoc array, functions, aliases
echo echo
echo "### Bash environment" echo "### Bash environment"
#stdout ssh -t lo <<'EOS' #stdout ssh -t lo <<'EOS'
myvar="myvar works" myvar="myvar works"
funky=$(perl -e 'print pack "c*", 1..255') funky=$(perl -e 'print pack "c*", 1..255')
alias alias_echo=echo; myarray=('' array_val2 3 '' 5)
declare -A assocarr
assocarr[a]=assoc_val_a
assocarr[b]=assoc_val_b
alias alias_echo="echo 3 arg";
func_echo() { func_echo() {
echo $*; echo $*;
echo "$myvar" echo "$myvar"
echo ${myarray[1]}
echo ${assocarr[a]}
echo Funky-"$funky"-funky echo Funky-"$funky"-funky
} }
@ -122,68 +146,35 @@ env_parallel -S lo func_echo ::: function_works_over_ssh
#EOS #EOS
echo "### Fish environment"
stdout ssh -q fish@lo <<'EOS' | egrep -v 'Welcome to |packages can be updated.'
set myvar "myvar works"
# ` (ascii 39) is a problem
set funky (perl -e 'print pack "c*", 1..38,40..255')
alias alias_echo=echo;
function func_echo
echo $argv;
echo $myvar;
echo Funky-"$funky"-funky
end
function env_parallel
setenv PARALLEL_ENV (begin; \
set -L|perl -ne '
/^(status|version|history|PWD|SHLVL|USER|_|COLUMNS|FISH_VERSION|HOME|LINES) /
or s/^/set / and print
'; \
functions -n | perl -pe 's/,/\n/g' | while read d; functions $d; end; \
end|perl -pe 's/\n/\001/')
parallel $argv;
set -e PARALLEL_ENV
end
env_parallel alias_echo ::: alias_works
env_parallel func_echo ::: function_works
env_parallel -S fish@lo alias_echo ::: alias_works_over_ssh
env_parallel -S fish@lo func_echo ::: function_works_over_ssh
EOS
echo echo
echo "### Zsh environment" echo "### Zsh environment"
stdout ssh -q zsh@lo <<'EOS' | egrep -v 'Welcome to |packages can be updated.' stdout ssh -q zsh@lo <<'EOS' | egrep -v 'Welcome to |packages can be updated.'
myvar="myvar works" myvar="myvar works"
funky=$(perl -e 'print pack "c*", 1..255') funky=$(perl -e 'print pack "c*", 1..255')
alias alias_echo=echo; myarray=('' array_val2 3 '' 5)
declare -A assocarr
assocarr[a]=assoc_val_a
assocarr[b]=assoc_val_b
alias alias_echo="echo 3 arg";
func_echo() { func_echo() {
echo $*; echo $*;
echo "$myvar" echo "$myvar"
echo $myarray[2]
echo ${assocarr[a]}
echo Funky-"$funky"-funky echo Funky-"$funky"-funky
} }
env_parallel() {
PARALLEL_ENV="$(typeset -f)";
export PARALLEL_ENV
`which parallel` "$@";
unset PARALLEL_ENV;
}
env_parallel() { env_parallel() {
unset PARALLEL_ENV; unset PARALLEL_ENV;
export PARALLEL_ENV="$(alias | perl -pe 's/^/alias /';typeset -p | export PARALLEL_ENV="$(alias | perl -pe 's/^/alias /';typeset -p |
grep -aFvf <(typeset -pr)|egrep -iav 'ZSH_EVAL_CONTEXT|LINENO=| _=|aliases|^typeset [a-z_]+$'| grep -aFvf <(typeset -pr)|egrep -iav 'ZSH_EVAL_CONTEXT|LINENO=| _=|aliases|^typeset [a-z_]+$'|
egrep -av '^(typeset IFS=|..$)|cyan' egrep -av '^(typeset IFS=|..$)|cyan';
;
typeset -f)"; typeset -f)";
parallel "$@"; parallel "$@";
} }
# alias does not work: http://unix.stackexchange.com/questions/223534/defining-an-alias-and-immediately-use-it
env_parallel alias_echo ::: alias_does_not_work env_parallel alias_echo ::: alias_does_not_work
env_parallel func_echo ::: function_works env_parallel func_echo ::: function_works
env_parallel -S zsh@lo alias_echo ::: alias_does_not_work_over_ssh env_parallel -S zsh@lo alias_echo ::: alias_does_not_work_over_ssh
env_parallel -S zsh@lo func_echo ::: function_works_over_ssh env_parallel -S zsh@lo func_echo ::: function_works_over_ssh
@ -193,15 +184,25 @@ echo
echo "### Ksh environment" echo "### Ksh environment"
stdout ssh -q ksh@lo <<'EOS' | egrep -v 'Welcome to |packages can be updated.' stdout ssh -q ksh@lo <<'EOS' | egrep -v 'Welcome to |packages can be updated.'
myvar="myvar works" myvar="myvar works"
alias alias_echo=echo; funky=$(perl -e 'print pack "c*", 1..255')
myarray=('' array_val2 3 '' 5)
typeset -A assocarr
assocarr[a]=assoc_val_a
assocarr[b]=assoc_val_b
alias alias_echo="echo 3 arg";
func_echo() { func_echo() {
echo $*; echo $*;
echo "$myvar" echo "$myvar"
echo ${myarray[1]}
echo ${assocarr[a]}
echo Funky-"$funky"-funky
} }
env_parallel() { env_parallel() {
unset PARALLEL_ENV;
export PARALLEL_ENV="$(alias | perl -pe 's/^/alias /';typeset -p|egrep -v 'typeset( -i)? -r|PIPESTATUS';typeset -f)"; export PARALLEL_ENV="$(alias | perl -pe 's/^/alias /';typeset -p|egrep -v 'typeset( -i)? -r|PIPESTATUS';typeset -f)";
`which parallel` "$@"; `which parallel` "$@";
unset PARALLEL_ENV;
} }
env_parallel alias_echo ::: alias_works env_parallel alias_echo ::: alias_works
env_parallel func_echo ::: function_works env_parallel func_echo ::: function_works
@ -209,3 +210,50 @@ env_parallel -S ksh@lo alias_echo ::: alias_works_over_ssh
env_parallel -S ksh@lo func_echo ::: function_works_over_ssh env_parallel -S ksh@lo func_echo ::: function_works_over_ssh
EOS EOS
echo
echo "### csh environment"
stdout ssh -q csh@lo <<'EOS' | egrep -v 'Welcome to |packages can be updated.'
set myvar = "myvar works"
set funky = "`perl -e 'print pack q(c*), 1..255'`"
set myarray = ('' 'array_val2' '3' '' '5')
#declare -A assocarr
#assocarr[a]=assoc_val_a
#assocarr[b]=assoc_val_b
alias alias_echo echo 3 arg;
#function func_echo
# echo $argv;
# echo $myvar;
# echo ${myarray[2]}
# #echo ${assocarr[a]}
# echo Funky-"$funky"-funky
#end
# s/'/'"'"'/g;
# ' => \047 " => \042
# s/\047/\047\042\047\042\047/g;
# Quoted: s/\\047/\\047\\042\\047\\042\\047/g\;
# s/^(\S+)(\s+)\((.*)\)/\1\2\3/
# \047 => '
# s/^(\S+)(\s+)\((.*)\)/\1\2\3/;
# Quoted: s/\^\(\\S+\)\(\\s+\)\\\(\(.\*\)\\\)/\\1\\2\\3/\;
# s/^(\S+)(\s+)(.*)/\1\2'\3'/
# \047 => '
# s/^(\S+)(\s+)(.*)/\1\2\047\3\047/;
# Quoted: s/\^\(\\S+\)\(\\s+\)\(.\*\)/\\1\\2\\047\\3\\047/\;
# s/^/\001alias /;
# Quoted: s/\^/\\001alias\ /\;
alias env_parallel 'setenv PARALLEL_ENV "`alias | perl -pe s/\\047/\\047\\042\\047\\042\\047/g\;s/\^\(\\S+\)\(\\s+\)\\\(\(.\*\)\\\)/\\1\\2\\3/\;s/\^\(\\S+\)\(\\s+\)\(.\*\)/\\1\\2\\047\\3\\047/\;s/\^/\\001alias\ /\;`"'
alias pp 'parallel \!*'
env_parallel alias_echo ::: alias_works
env_parallel func_echo ::: function_works
env_parallel -S csh@lo alias_echo ::: alias_works_over_ssh
env_parallel -S csh@lo func_echo ::: function_works_over_ssh
EOS

View file

@ -49,20 +49,6 @@ echo 'bug #44144: --tagstring {=s/a/b/=} broken'
# Non-standard --parens -i # Non-standard --parens -i
parallel --rpl '{:} s/A/D/;{}' --tag --parens ,, -iDUMMY echo {} ::: A/B.C parallel --rpl '{:} s/A/D/;{}' --tag --parens ,, -iDUMMY echo {} ::: A/B.C
echo 'env in zsh'
echo 'Normal variable export'
export B=\';
PARALLEL_SHELL=/usr/bin/zsh parallel --env B echo '$B' ::: a
echo 'Function export as variable'
export myfuncvar="() { echo myfuncvar \$*; }";
PARALLEL_SHELL=/usr/bin/zsh parallel --env myfuncvar myfuncvar ::: a
echo 'Function export as function'
myfunc() { echo myfunc $*; };
export -f myfunc;
PARALLEL_SHELL=/usr/bin/zsh parallel --env myfunc myfunc ::: a
echo 'bug #45692: Easy way of cancelling a job in {= =} and' echo 'bug #45692: Easy way of cancelling a job in {= =} and'
echo 'bug #45691: Accessing multiple arguments in {= =}' echo 'bug #45691: Accessing multiple arguments in {= =}'
parallel -k echo {= '$arg[1] eq 2 and $job->skip()' =} ::: {1..5} parallel -k echo {= '$arg[1] eq 2 and $job->skip()' =} ::: {1..5}

View file

@ -10,6 +10,7 @@ P_WORKING="minix freebsd solaris openbsd netbsd debian aix redhat hpux qnx tru64
P="$P_WORKING" P="$P_WORKING"
POLAR=`parallel -k echo {}.polarhome.com ::: $P` POLAR=`parallel -k echo {}.polarhome.com ::: $P`
S_POLAR=`parallel -k echo -S 1/{}.polarhome.com ::: $P`
# Avoid the stupid /etc/issue.net banner at Polarhome: -oLogLevel=quiet # Avoid the stupid /etc/issue.net banner at Polarhome: -oLogLevel=quiet
echo '### Tests on polarhome machines' echo '### Tests on polarhome machines'
@ -38,5 +39,8 @@ export -f copy_and_test
# 20150414 --timeout 80 -> 40 # 20150414 --timeout 80 -> 40
stdout parallel -j0 -k --retries 5 --timeout 40 --delay 0.1 --tag -v copy_and_test {} ::: $POLAR stdout parallel -j0 -k --retries 5 --timeout 40 --delay 0.1 --tag -v copy_and_test {} ::: $POLAR
# Test remote wrapper working on all platforms
parallel -j0 --nonall -k $S_POLAR hostname
cat /tmp/test_empty_cmd cat /tmp/test_empty_cmd
rm /tmp/test_empty_cmd rm /tmp/test_empty_cmd

View file

@ -0,0 +1,9 @@
echo '### test memfree'
### test memfree
parallel --memfree 1k echo Free mem: ::: 1k
Free mem: 1k
stdout parallel --timeout 3 --argsep II parallel --memfree 1t echo Free mem: ::: II 1t
parallel: SIGTERM received. No new jobs will be started.
parallel: Waiting for these 0 jobs to finish. Send SIGTERM again to stop now.
echo '**'
**

View file

@ -25,6 +25,20 @@ compared to parallel - no transfer non-exported var
variable variable
echo '### zsh' echo '### zsh'
### zsh ### zsh
echo 'env in zsh'
env in zsh
echo 'Normal variable export'
Normal variable export
export B=\'; PARALLEL_SHELL=/usr/bin/zsh parallel --env B echo '$B' ::: a
' a
echo 'Function export as variable'
Function export as variable
export myfuncvar="() { echo myfuncvar \$*; }"; PARALLEL_SHELL=/usr/bin/zsh parallel --env myfuncvar myfuncvar ::: a
myfuncvar a
echo 'Function export as function'
Function export as function
myfunc() { echo myfunc $*; }; export -f myfunc; PARALLEL_SHELL=/usr/bin/zsh parallel --env myfunc myfunc ::: a
myfunc a
ssh zsh@lo 'fun="() { echo function from zsh to zsh \$*; }"; export fun; parallel --env fun fun ::: OK' ssh zsh@lo 'fun="() { echo function from zsh to zsh \$*; }"; export fun; parallel --env fun fun ::: OK'
function from zsh to zsh OK function from zsh to zsh OK
ssh zsh@lo 'fun="() { echo function from zsh to bash \$*; }"; export fun; parallel -S parallel@lo --env fun fun ::: OK' ssh zsh@lo 'fun="() { echo function from zsh to bash \$*; }"; export fun; parallel -S parallel@lo --env fun fun ::: OK'
@ -47,9 +61,9 @@ echo '### csh2'
1 150 547 1 150 547
echo '### Test tmux works on different shells' echo '### Test tmux works on different shells'
### Test tmux works on different shells ### Test tmux works on different shells
parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux echo ::: 1 2 3 4; echo $? (stdout parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux echo ::: 1 2 3 4; echo $?) | grep -v 'See output';
0 0
parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux false ::: 1 2 3 4; echo $? (stdout parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux false ::: 1 2 3 4; echo $?) | grep -v 'See output';
4 4
export PARTMUX='parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux '; stdout ssh zsh@lo "$PARTMUX" 'true ::: 1 2 3 4; echo $status' | grep -v 'See output'; stdout ssh zsh@lo "$PARTMUX" 'false ::: 1 2 3 4; echo $status' | grep -v 'See output'; stdout ssh parallel@lo "$PARTMUX" 'true ::: 1 2 3 4; echo $?' | grep -v 'See output'; stdout ssh parallel@lo "$PARTMUX" 'false ::: 1 2 3 4; echo $?' | grep -v 'See output'; stdout ssh tcsh@lo "$PARTMUX" 'true ::: 1 2 3 4; echo $status' | grep -v 'See output'; stdout ssh tcsh@lo "$PARTMUX" 'false ::: 1 2 3 4; echo $status' | grep -v 'See output'; stdout ssh csh@lo "$PARTMUX" 'true ::: 1 2 3 4; echo $status' | grep -v 'See output'; stdout ssh csh@lo "$PARTMUX" 'false ::: 1 2 3 4; echo $status' | grep -v 'See output' export PARTMUX='parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux '; stdout ssh zsh@lo "$PARTMUX" 'true ::: 1 2 3 4; echo $status' | grep -v 'See output'; stdout ssh zsh@lo "$PARTMUX" 'false ::: 1 2 3 4; echo $status' | grep -v 'See output'; stdout ssh parallel@lo "$PARTMUX" 'true ::: 1 2 3 4; echo $?' | grep -v 'See output'; stdout ssh parallel@lo "$PARTMUX" 'false ::: 1 2 3 4; echo $?' | grep -v 'See output'; stdout ssh tcsh@lo "$PARTMUX" 'true ::: 1 2 3 4; echo $status' | grep -v 'See output'; stdout ssh tcsh@lo "$PARTMUX" 'false ::: 1 2 3 4; echo $status' | grep -v 'See output'; stdout ssh csh@lo "$PARTMUX" 'true ::: 1 2 3 4; echo $status' | grep -v 'See output'; stdout ssh csh@lo "$PARTMUX" 'false ::: 1 2 3 4; echo $status' | grep -v 'See output'
0 0
@ -95,39 +109,29 @@ echo '### bug #45575: -m and multiple hosts repeats first args'
Test env_parallel: Test env_parallel:
+ for each shell + for each shell
+ remote, locally + remote, locally
+ variables, variables with funky content, arrays, functions, aliases + variables, variables with funky content, arrays, assoc array, functions, aliases
### Bash environment ### Bash environment
alias_works 3 arg alias_works
function_works function_works
myvar works myvar works
array_val2
assoc_val_a
Funky- Funky-
 
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<EFBFBD><EFBFBD><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>-funky €亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<EFBFBD><EFBFBD><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>-funky
alias_works_over_ssh 3 arg alias_works_over_ssh
function_works_over_ssh function_works_over_ssh
myvar works myvar works
array_val2
assoc_val_a
Funky- Funky-
 
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<EFBFBD><EFBFBD><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>-funky €亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<EFBFBD><EFBFBD><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>-funky
### Fish environment
* Documentation: http://www.linuxmint.com
0 updates are security updates.
alias_works
function_works
myvar works
Funky-   !"#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<D096><E29486><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<E8B28A><E9BCAC><EFBFBD><EFBFBD>-funky
alias_works_over_ssh
function_works_over_ssh
myvar works
Funky-   !"#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<D096><E29486><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<E8B28A><E9BCAC><EFBFBD><EFBFBD>-funky
### Zsh environment ### Zsh environment
@ -135,15 +139,19 @@ Funky-   !"#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJK
0 updates are security updates. 0 updates are security updates.
zsh:124: command not found: alias_echo zsh:129: command not found: alias_echo
function_works function_works
myvar works myvar works
array_val2
assoc_val_a
Funky- Funky-
 
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<D096><E29486><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<E8B28A><E9BCAC><EFBFBD><EFBFBD>-funky  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<D096><E29486><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<E8B28A><E9BCAC><EFBFBD><EFBFBD>-funky
zsh:124: command not found: alias_echo zsh:129: command not found: alias_echo
function_works_over_ssh function_works_over_ssh
myvar works myvar works
array_val2
assoc_val_a
Funky- Funky-
 
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<D096><E29486><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<E8B28A><E9BCAC><EFBFBD><EFBFBD>-funky  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<D096><E29486><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<E8B28A><E9BCAC><EFBFBD><EFBFBD>-funky
@ -154,9 +162,27 @@ Funky-
0 updates are security updates. 0 updates are security updates.
alias_works 3 arg alias_works
function_works function_works
myvar works myvar works
alias_works_over_ssh array_val2
assoc_val_a
Funky-
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<D096><E29486><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<E8B28A><E9BCAC><EFBFBD><EFBFBD>-funky
3 arg alias_works_over_ssh
function_works_over_ssh function_works_over_ssh
myvar works myvar works
array_val2
assoc_val_a
Funky-
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<D096><E29486><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<E8B28A><E9BCAC><EFBFBD><EFBFBD>-funky
### csh environment
* Documentation: http://www.linuxmint.com
0 updates are security updates.
Warning: no access to tty (Bad file descriptor).
Thus no job control in this shell.
setenv: Too many arguments.

View file

@ -142,20 +142,6 @@ D/B.CD/B.CE/B.C A/B.C
# Non-standard --parens -i # Non-standard --parens -i
parallel --rpl '{:} s/A/D/;{}' --tag --parens ,, -iDUMMY echo {} ::: A/B.C parallel --rpl '{:} s/A/D/;{}' --tag --parens ,, -iDUMMY echo {} ::: A/B.C
A/B.C {} A/B.C A/B.C {} A/B.C
echo 'env in zsh'
env in zsh
echo 'Normal variable export'
Normal variable export
export B=\'; PARALLEL_SHELL=/usr/bin/zsh parallel --env B echo '$B' ::: a
' a
echo 'Function export as variable'
Function export as variable
export myfuncvar="() { echo myfuncvar \$*; }"; PARALLEL_SHELL=/usr/bin/zsh parallel --env myfuncvar myfuncvar ::: a
myfuncvar a
echo 'Function export as function'
Function export as function
myfunc() { echo myfunc $*; }; export -f myfunc; PARALLEL_SHELL=/usr/bin/zsh parallel --env myfunc myfunc ::: a
myfunc a
echo 'bug #45692: Easy way of cancelling a job in {= =} and' echo 'bug #45692: Easy way of cancelling a job in {= =} and'
bug #45692: Easy way of cancelling a job in {= =} and bug #45692: Easy way of cancelling a job in {= =} and
echo 'bug #45691: Accessing multiple arguments in {= =}' echo 'bug #45691: Accessing multiple arguments in {= =}'

View file

@ -113,5 +113,28 @@ copy_and_test pidora.polarhome.com
pidora.polarhome.com ### Run the test on pidora.polarhome.com pidora.polarhome.com ### Run the test on pidora.polarhome.com
pidora.polarhome.com Works on pidora.polarhome.com pidora.polarhome.com Works on pidora.polarhome.com
pidora.polarhome.com Error in tempfile() using template /XXXXXXXX.arg: Could not create temp file /XXXXXXXX.arg: Permission denied at bin/parallel line 0000. pidora.polarhome.com Error in tempfile() using template /XXXXXXXX.arg: Could not create temp file /XXXXXXXX.arg: Permission denied at bin/parallel line 0000.
aix7
centos.polarhome.com
debian
dragonfly.polarhome.com
freebsd.polarhome.com
hpux64
hurd
macosx
mandriva.polarhome.com
miros.polarhome.com
netbsd.polarhome.com
openbsd.polarhome.com
openindiana
pidora
qnx
raspbian
scosysv.polarhome.com
solaris-x86
solaris
suse
tru64.polarhome.com
ubuntu
unixware.polarhome.com
macosx.polarhome.com ### Test if empty command in process list causes problems macosx.polarhome.com ### Test if empty command in process list causes problems
macosx.polarhome.com OK_with_empty_cmd macosx.polarhome.com OK_with_empty_cmd