echo '### --env from man env_parallel' ### --env from man env_parallel echo '### bash' ### bash ssh bash@lo ' alias myecho="echo aliases"; env_parallel myecho ::: work; env_parallel -S server myecho ::: work; env_parallel --env myecho myecho ::: work; env_parallel --env myecho -S server myecho ::: work ' aliases work aliases work aliases work aliases work ssh bash@lo ' myfunc() { echo functions $*; }; env_parallel myfunc ::: work; env_parallel -S server myfunc ::: work; env_parallel --env myfunc myfunc ::: work; env_parallel --env myfunc -S server myfunc ::: work ' functions work functions work functions work functions work ssh bash@lo ' myvar=variables; env_parallel echo "\$myvar" ::: work; env_parallel -S server echo "\$myvar" ::: work; env_parallel --env myvar echo "\$myvar" ::: work; env_parallel --env myvar -S server echo "\$myvar" ::: work ' variables work variables work variables work variables work ssh bash@lo ' myarray=(arrays work, too); env_parallel -k echo "\${myarray[{}]}" ::: 0 1 2; env_parallel -k -S server echo "\${myarray[{}]}" ::: 0 1 2; env_parallel -k --env myarray echo "\${myarray[{}]}" ::: 0 1 2; env_parallel -k --env myarray -S server echo "\${myarray[{}]}" ::: 0 1 2 ' arrays work, too arrays work, too arrays work, too arrays work, too echo '### zsh' ### zsh ssh zsh@lo ' alias myecho="echo aliases"; env_parallel myecho ::: work; env_parallel -S server myecho ::: work; env_parallel --env myecho myecho ::: work; env_parallel --env myecho -S server myecho ::: work ' aliases work aliases work aliases work aliases work ssh zsh@lo ' myfunc() { echo functions $*; }; env_parallel myfunc ::: work; env_parallel -S server myfunc ::: work; env_parallel --env myfunc myfunc ::: work; env_parallel --env myfunc -S server myfunc ::: work ' functions work functions work functions work functions work ssh zsh@lo ' myvar=variables; env_parallel echo "\$myvar" ::: work; env_parallel -S server echo "\$myvar" ::: work; env_parallel --env myvar echo "\$myvar" ::: work; env_parallel --env myvar -S server echo "\$myvar" ::: work ' variables work variables work variables work variables work ssh zsh@lo ' myarray=(arrays work, too); env_parallel -k echo "\${myarray[{}]}" ::: 1 2 3; env_parallel -k -S server echo "\${myarray[{}]}" ::: 1 2 3; env_parallel -k --env myarray echo "\${myarray[{}]}" ::: 1 2 3; env_parallel -k --env myarray -S server echo "\${myarray[{}]}" ::: 1 2 3 ' arrays work, too arrays work, too arrays work, too arrays work, too echo '### ksh' ### ksh ssh ksh@lo ' . `which env_parallel.ksh`; alias myecho="echo aliases"; env_parallel myecho ::: work; env_parallel -S server myecho ::: work; env_parallel --env myecho myecho ::: work; env_parallel --env myecho -S server myecho ::: work ' aliases work aliases work aliases work aliases work ssh ksh@lo ' . `which env_parallel.ksh`; myfunc() { echo functions $*; }; env_parallel myfunc ::: work; env_parallel -S server myfunc ::: work; env_parallel --env myfunc myfunc ::: work; env_parallel --env myfunc -S server myfunc ::: work ' functions work functions work functions work functions work ssh ksh@lo ' . `which env_parallel.ksh`; myvar=variables; env_parallel echo "\$myvar" ::: work; env_parallel -S server echo "\$myvar" ::: work; env_parallel --env myvar echo "\$myvar" ::: work; env_parallel --env myvar -S server echo "\$myvar" ::: work ' variables work variables work variables work variables work ssh ksh@lo ' . `which env_parallel.ksh`; myarray=(arrays work, too); env_parallel -k echo "\${myarray[{}]}" ::: 0 1 2; env_parallel -k -S server echo "\${myarray[{}]}" ::: 0 1 2; env_parallel -k --env myarray echo "\${myarray[{}]}" ::: 0 1 2; env_parallel -k --env myarray -S server echo "\${myarray[{}]}" ::: 0 1 2 ' arrays work, too arrays work, too arrays work, too arrays work, too echo '### --env _' ### --env _ fUbAr="OK FUBAR" parallel -S parallel@lo --env _ echo '$fUbAr $DEBEMAIL' ::: test OK FUBAR test fUbAr="OK FUBAR" parallel -S csh@lo --env _ echo '$fUbAr $DEBEMAIL' ::: test echo '### --env _ with explicit mentioning of normally ignored var $DEBEMAIL' ### --env _ with explicit mentioning of normally ignored var $DEBEMAIL fUbAr="OK FUBAR" parallel -S parallel@lo --env DEBEMAIL,_ echo '$fUbAr $DEBEMAIL' ::: test OK FUBAR ole@tange.dk test fUbAr="OK FUBAR" parallel -S csh@lo --env DEBEMAIL,_ echo '$fUbAr $DEBEMAIL' ::: test OK FUBAR ole@tange.dk test echo 'bug #40137: SHELL not bash: Warning when exporting funcs' bug #40137: SHELL not bash: Warning when exporting funcs . <(printf 'myfunc() {\necho $1\n}'); export -f myfunc; parallel --env myfunc -S lo myfunc ::: no_warning no_warning . <(printf 'myfunc() {\necho $1\n}'); export -f myfunc; SHELL=/bin/sh parallel --env myfunc -S lo myfunc ::: warning warning echo 'env_parallel from man page - transfer non-exported var' env_parallel from man page - transfer non-exported var source $(which env_parallel.bash); var=nonexported env_parallel -S parallel@lo echo '$var' ::: variable nonexported variable echo 'compared to parallel - no transfer non-exported var' compared to parallel - no transfer non-exported var var=nonexported parallel -S parallel@lo echo '$var' ::: variable variable echo '### 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' 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' function from zsh to bash OK echo '### csh' ### csh echo "3 big vars run remotely - length(base64) > 1000" 3 big vars run remotely - length(base64) > 1000 stdout ssh csh@lo 'setenv A `seq 200|xargs`; setenv B `seq 200 -1 1|xargs`; setenv C `seq 300 -2 1|xargs`; parallel -Scsh@lo --env A,B,C -k echo \$\{\}\|wc ::: A B C' 1 200 692 1 200 692 1 150 547 echo '### csh2' ### csh2 echo "3 big vars run locally" 3 big vars run locally stdout ssh csh@lo 'setenv A `seq 200|xargs`; setenv B `seq 200 -1 1|xargs`; setenv C `seq 300 -2 1|xargs`; parallel --env A,B,C -k echo \$\{\}\|wc ::: A B C' 1 200 692 1 200 692 1 150 547 echo '### rc' ### rc echo "3 big vars run remotely - length(base64) > 1000" 3 big vars run remotely - length(base64) > 1000 stdout ssh rc@lo 'A=`{seq 200}; B=`{seq 200 -1 1}; C=`{seq 300 -2 1}; parallel -Src@lo --env A,B,C -k echo '"'"'${}|wc'"'"' ::: A B C' 1 200 692 1 200 692 1 150 547 echo '### rc2' ### rc2 echo "3 big vars run locally" 3 big vars run locally stdout ssh rc@lo 'A=`{seq 200}; B=`{seq 200 -1 1}; C=`{seq 300 -2 1}; parallel --env A,B,C -k echo '"'"'${}|wc'"'"' ::: A B C' 1 200 692 1 200 692 1 150 547 echo '### Test tmux works on different shells' ### Test tmux works on different shells (stdout parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux echo ::: 1 2 3 4; echo $?) | grep -v 'See output'; 0 (stdout parallel -Scsh@lo,tcsh@lo,parallel@lo,zsh@lo --tmux false ::: 1 2 3 4; echo $?) | grep -v 'See output'; 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'; echo "# command is currently too long for csh. Maybe it can be fixed?"; 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 4 0 4 0 4 # command is currently too long for csh. Maybe it can be fixed? Word too long. Word too long. Word too long. Word too long. 4 Word too long. Word too long. Word too long. Word too long. 4 echo '### works' ### works stdout parallel -Sparallel@lo --tmux echo ::: \\\\\\\"\\\\\\\"\\\;\@ | grep -v 'See output' stdout parallel -Sparallel@lo --tmux echo ::: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | grep -v 'See output' parallel: Error: Command line too long (402 >= 118) at input 0: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... echo '### These blocked due to length' ### These blocked due to length stdout parallel -Slo --tmux echo ::: \\\\\\\"\\\\\\\"\\\;\@ | grep -v 'See output' stdout parallel -Scsh@lo --tmux echo ::: \\\\\\\"\\\\\\\"\\\;\@ | grep -v 'See output' stdout parallel -Stcsh@lo --tmux echo ::: \\\\\\\"\\\\\\\"\\\;\@ | grep -v 'See output' stdout parallel -Szsh@lo --tmux echo ::: \\\\\\\"\\\\\\\"\\\;\@ | grep -v 'See output' stdout parallel -Scsh@lo --tmux echo ::: 111111111111111111111111111111111111111111111111111111111 | grep -v 'See output' echo '### bug #43746: --transfer and --return of multiple inputs {1} and {2}' ### bug #43746: --transfer and --return of multiple inputs {1} and {2} echo '### and:' ### and: echo '### bug #44371: --trc with csh complains' ### bug #44371: --trc with csh complains cd /tmp; echo 1 > file1; echo 2 > file2; parallel -Scsh@lo --transferfile {1} --transferfile {2} --trc {1}.a --trc {2}.b '(cat {1}; echo A {1}) > {1}.a; (cat {2};echo B {2}) > {2}.b' ::: file1 ::: file2; cat file1.a file2.b; rm /tmp/file1 /tmp/file2 /tmp/file1.a /tmp/file2.b 1 A file1 2 B file2 echo '### bug #44143: csh and nice' ### bug #44143: csh and nice parallel --nice 1 -S csh@lo setenv B {}\; echo '$B' ::: OK OK echo '### bug #45575: -m and multiple hosts repeats first args' ### bug #45575: -m and multiple hosts repeats first args seq 1 3 | parallel -X -S 2/lo,2/: -k echo 1 2 3 Test env_parallel: + for each shell + remote, locally + variables, variables with funky content, arrays, assoc array, functions, aliases ### Bash environment 3 arg alias_works function_works myvar works space 6 assoc_val_a Funky-   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ -funky 3 arg alias_works_over_ssh function_works_over_ssh myvar works space 6 assoc_val_a Funky-   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ -funky \\\\\\\\ \ \ \ \\\\\\\\\\\\\\ \!\"\#\$%\&\'\(\)\*+,-./0123456789:\;\<\=\>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_\`abcdefghijklmnopqrstuvwxyz\{\|\}\~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ### Zsh environment * Documentation: http://www.linuxmint.com 3 arg alias_works function_works myvar works space 6 assoc_val_a Funky-   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-funky 3 arg alias_works_over_ssh function_works_over_ssh myvar works space 6 assoc_val_a Funky-   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-funky \\\\\\\\ \ \ \ \\\\\\\\\\\\\\ \!\"\#\$%\&\'\(\)\*+,-./0123456789:\;\<\=\>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_\`abcdefghijklmnopqrstuvwxyz\{\|\}\~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ### Ksh environment * Documentation: http://www.linuxmint.com 3 arg alias_works function_works myvar works space 6 assoc_val_a Funky-  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-funky 3 arg alias_works_over_ssh function_works_over_ssh myvar works space 6 assoc_val_a Funky-  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-funky \\\\\\\\ \ \ \ \\\\\\\\\\\\\\ \!\"\#\$%\&\'\(\)\*+,-./0123456789:\;\<\=\>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_\`abcdefghijklmnopqrstuvwxyz\{\|\}\~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ### Fish environment * Documentation: http://www.linuxmint.com env_parallel: Warning: ASCII value 1 in variables is not supported env_parallel: Warning: ASCII value 1 in variables is not supported 3 arg alias_works env_parallel: Warning: ASCII value 1 in variables is not supported env_parallel: Warning: ASCII value 1 in variables is not supported function_works myvar works myenvvar works space 6 Funky-   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-funky Funkyenv-   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-funkyenv env_parallel: Warning: ASCII value 1 in variables is not supported env_parallel: Warning: ASCII value 1 in variables is not supported 3 arg alias_works_over_ssh env_parallel: Warning: ASCII value 1 in variables is not supported env_parallel: Warning: ASCII value 1 in variables is not supported function_works_over_ssh myvar works myenvvar works space 6 Funky-   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-funky Funkyenv-   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-funkyenv \\\\\\\\ \ \ \ \ \\\\\\\\\\\\\\ \ \!\"\#\$%\&\'\(\)\*+,-./0123456789:\;\<\=\>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_\`abcdefghijklmnopqrstuvwxyz\{\|\}\~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ### csh environment * Documentation: http://www.linuxmint.com Warning: no access to tty (Bad file descriptor). Thus no job control in this shell. 3 arg alias_works myvar works space special chars problem Funky-  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-funky alias_var_works func_echo: Command not found. 3 arg alias_works_over_ssh myvar works space special chars problem Funky-  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-funky alias_var_works_over_ssh func_echo: Command not found. \\\\\\\\ \ \ \ \ \\\\\\\\\\\\\\ \!\"\#\$%\&\'\(\)\*+,-./0123456789:\;\<\=\>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_\`abcdefghijklmnopqrstuvwxyz\{\|\}\~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\