From 77599baa9637a272a1894117c1e2f7e0fc9ddacf Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sun, 3 Dec 2017 01:40:01 +0100 Subject: [PATCH] env_parallel: bugfix of ash/dash/sh + increased testing. --- src/env_parallel.ash | 24 +- src/env_parallel.bash | 6 +- src/env_parallel.dash | 26 +- src/env_parallel.ksh | 17 +- src/env_parallel.sh | 18 +- src/env_parallel.zsh | 22 +- testsuite/tests-to-run/parallel-local-ssh7.sh | 1816 ++++++++++------- testsuite/tests-to-run/parallel-local-ssh8.sh | 1 + testsuite/wanted-results/parallel-local-ssh7 | 290 ++- 9 files changed, 1434 insertions(+), 786 deletions(-) diff --git a/src/env_parallel.ash b/src/env_parallel.ash index 81dc5a74..daa9e291 100755 --- a/src/env_parallel.ash +++ b/src/env_parallel.ash @@ -29,15 +29,25 @@ env_parallel() { # based on env_parallel.sh _names_of_ALIASES() { - alias | perl -ne 's/^alias //;s/^(\S+)=.*/$1/ and print' + for _i in `alias | perl -ne 's/^alias //;s/^(\S+)=.*/$1/ && print' 2>/dev/null`; do + # Check if this name really is an alias + # or just part of a multiline alias definition + if alias $_i >/dev/null 2>/dev/null; then + echo $_i + fi + done } _bodies_of_ALIASES() { + # alias may return: + # myalias='definition' (GNU/Linux ash) + # alias myalias='definition' (FreeBSD ash) + # so remove 'alias ' from first line for _i in "$@"; do - echo 'alias '"`alias $_i`" + echo 'alias '"`alias $_i | perl -pe '1..1 and s/^alias //'`" done } _names_of_maybe_FUNCTIONS() { - set | perl -ne '/^(\S+)\(\)\{$/ and print "$1\n"' + set | perl -ne '/^([A-Z_0-9]+)\s*\(\)\s*\{?$/i and print "$1\n"' } _names_of_FUNCTIONS() { # myfunc is a function @@ -134,7 +144,7 @@ env_parallel() { fi # Grep alias names - _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES`" + _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES | xargs echo`" _list_alias_BODIES="_bodies_of_ALIASES $_alias_NAMES" if [ "$_alias_NAMES" = "" ] ; then # no aliases selected @@ -143,7 +153,7 @@ env_parallel() { unset _alias_NAMES # Grep function names - _function_NAMES="`_names_of_FUNCTIONS | _remove_bad_NAMES`" + _function_NAMES="`_names_of_FUNCTIONS | _remove_bad_NAMES | xargs echo`" _list_function_BODIES="_bodies_of_FUNCTIONS $_function_NAMES" if [ "$_function_NAMES" = "" ] ; then # no functions selected @@ -152,7 +162,7 @@ env_parallel() { unset _function_NAMES # Grep variable names - _variable_NAMES="`_names_of_VARIABLES | _remove_bad_NAMES`" + _variable_NAMES="`_names_of_VARIABLES | _remove_bad_NAMES | xargs echo`" _list_variable_VALUES="_bodies_of_VARIABLES $_variable_NAMES" if [ "$_variable_NAMES" = "" ] ; then # no variables selected @@ -172,7 +182,7 @@ env_parallel() { unset _grep_REGEXP unset _ignore_UNDERSCORE # Test if environment is too big - if `which true` >/dev/null ; then + if `which true` >/dev/null 2>/dev/null ; then `which parallel` "$@"; _parallel_exit_CODE=$? unset PARALLEL_ENV; diff --git a/src/env_parallel.bash b/src/env_parallel.bash index 922a5845..2c3e246b 100755 --- a/src/env_parallel.bash +++ b/src/env_parallel.bash @@ -137,7 +137,7 @@ env_parallel() { fi # Grep alias names - _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES`" + _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES | xargs echo`" _list_alias_BODIES="_bodies_of_ALIASES $_alias_NAMES" if [ "$_alias_NAMES" = "" ] ; then # no aliases selected @@ -146,7 +146,7 @@ env_parallel() { unset _alias_NAMES # Grep function names - _function_NAMES="`_names_of_FUNCTIONS | _remove_bad_NAMES`" + _function_NAMES="`_names_of_FUNCTIONS | _remove_bad_NAMES | xargs echo`" _list_function_BODIES="_bodies_of_FUNCTIONS $_function_NAMES" if [ "$_function_NAMES" = "" ] ; then # no functions selected @@ -155,7 +155,7 @@ env_parallel() { unset _function_NAMES # Grep variable names - _variable_NAMES="`_names_of_VARIABLES | _remove_bad_NAMES`" + _variable_NAMES="`_names_of_VARIABLES | _remove_bad_NAMES | xargs echo`" _list_variable_VALUES="_bodies_of_VARIABLES $_variable_NAMES" if [ "$_variable_NAMES" = "" ] ; then # no variables selected diff --git a/src/env_parallel.dash b/src/env_parallel.dash index 93f25c60..9c471d4a 100755 --- a/src/env_parallel.dash +++ b/src/env_parallel.dash @@ -29,13 +29,25 @@ env_parallel() { # based on env_parallel.sh _names_of_ALIASES() { - alias | perl -pe 's/^alias //;s/=.*//' + for _i in `alias | perl -ne 's/^alias //;s/^(\S+)=.*/$1/ && print' 2>/dev/null`; do + # Check if this name really is an alias + # or just part of a multiline alias definition + if alias $_i >/dev/null 2>/dev/null; then + echo $_i + fi + done } _bodies_of_ALIASES() { - alias "$@" | perl -pe 's/^(alias )?/alias /' + # alias may return: + # myalias='definition' (GNU/Linux ash) + # alias myalias='definition' (FreeBSD ash) + # so remove 'alias ' from first line + for _i in "$@"; do + echo 'alias '"`alias $_i | perl -pe '1..1 and s/^alias //'`" + done } _names_of_maybe_FUNCTIONS() { - set | perl -ne '/^(\S+)\(\)\{$/ and print "$1\n"' + set | perl -ne '/^([A-Z_0-9]+)\s*\(\)\s*\{?$/i and print "$1\n"' } _names_of_FUNCTIONS() { # myfunc is a function @@ -132,7 +144,7 @@ env_parallel() { fi # Grep alias names - _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES`" + _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES | xargs echo`" _list_alias_BODIES="_bodies_of_ALIASES $_alias_NAMES" if [ "$_alias_NAMES" = "" ] ; then # no aliases selected @@ -141,7 +153,7 @@ env_parallel() { unset _alias_NAMES # Grep function names - _function_NAMES="`_names_of_FUNCTIONS | _remove_bad_NAMES`" + _function_NAMES="`_names_of_FUNCTIONS | _remove_bad_NAMES | xargs echo`" _list_function_BODIES="_bodies_of_FUNCTIONS $_function_NAMES" if [ "$_function_NAMES" = "" ] ; then # no functions selected @@ -150,7 +162,7 @@ env_parallel() { unset _function_NAMES # Grep variable names - _variable_NAMES="`_names_of_VARIABLES | _remove_bad_NAMES`" + _variable_NAMES="`_names_of_VARIABLES | _remove_bad_NAMES | xargs echo`" _list_variable_VALUES="_bodies_of_VARIABLES $_variable_NAMES" if [ "$_variable_NAMES" = "" ] ; then # no variables selected @@ -170,7 +182,7 @@ env_parallel() { unset _grep_REGEXP unset _ignore_UNDERSCORE # Test if environment is too big - if `which true` >/dev/null ; then + if `which true` >/dev/null 2>/dev/null ; then `which parallel` "$@"; _parallel_exit_CODE=$? unset PARALLEL_ENV; diff --git a/src/env_parallel.ksh b/src/env_parallel.ksh index e1ff5210..1e221c1c 100755 --- a/src/env_parallel.ksh +++ b/src/env_parallel.ksh @@ -32,7 +32,14 @@ env_parallel() { alias | perl -pe 's/=.*//' } _bodies_of_ALIASES() { - alias "$@" | perl -pe 's/^/alias /' + alias "$@" | perl -pe 's/^/alias /; + sub warning { print STDERR "env_parallel: Warning: @_\n"; } + if(/^alias (\S+)=\$.*\\n/) { + warning("Alias \"$1\" contains newline."); + warning("Make sure the command has at least one newline after \"$1\"."); + warning("See BUGS in \"man env_parallel\"."); + }' + } _names_of_maybe_FUNCTIONS() { true not used @@ -122,7 +129,7 @@ env_parallel() { fi # Grep alias names - _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES`" + _alias_NAMES="`_names_of_ALIASES | _remove_bad_NAMES | xargs echo`" _list_alias_BODIES="_bodies_of_ALIASES $_alias_NAMES" if [ "$_alias_NAMES" = "" ] ; then # no aliases selected @@ -131,7 +138,7 @@ env_parallel() { unset _alias_NAMES # Grep function names - _function_NAMES="`_names_of_FUNCTIONS | _remove_bad_NAMES`" + _function_NAMES="`_names_of_FUNCTIONS | _remove_bad_NAMES | xargs echo`" _list_function_BODIES="_bodies_of_FUNCTIONS $_function_NAMES" if [ "$_function_NAMES" = "" ] ; then # no functions selected @@ -140,7 +147,7 @@ env_parallel() { unset _function_NAMES # Grep variable names - _variable_NAMES="`_names_of_VARIABLES | _remove_bad_NAMES`" + _variable_NAMES="`_names_of_VARIABLES | _remove_bad_NAMES | xargs echo`" _list_variable_VALUES="_bodies_of_VARIABLES $_variable_NAMES" if [ "$_variable_NAMES" = "" ] ; then # no variables selected @@ -160,7 +167,7 @@ env_parallel() { unset _grep_REGEXP unset _ignore_UNDERSCORE # Test if environment is too big - if `which true` >/dev/null ; then + if `which true` >/dev/null 2>/dev/null ; then `which parallel` "$@"; _parallel_exit_CODE=$? unset PARALLEL_ENV; diff --git a/src/env_parallel.sh b/src/env_parallel.sh index 83f40c0c..64029a7d 100755 --- a/src/env_parallel.sh +++ b/src/env_parallel.sh @@ -29,10 +29,22 @@ env_parallel() { # env_parallel.sh _names_of_ALIASES() { - alias | perl -pe 's/^alias //;s/=.*//' + for _i in `alias | perl -ne 's/^alias //;s/^(\S+)=.*/$1/ && print' 2>/dev/null`; do + # Check if this name really is an alias + # or just part of a multiline alias definition + if alias $_i >/dev/null 2>/dev/null; then + echo $_i + fi + done } _bodies_of_ALIASES() { - alias "$@" | perl -pe 's/^(alias )?/alias /' + # alias may return: + # myalias='definition' (GNU/Linux ash) + # alias myalias='definition' (FreeBSD ash) + # so remove 'alias ' from first line + for _i in "$@"; do + echo 'alias '"`alias $_i | perl -pe '1..1 and s/^alias //'`" + done } _names_of_maybe_FUNCTIONS() { set | perl -ne '/^([A-Z_0-9]+)\s*\(\)\s*\{?$/i and print "$1\n"' @@ -170,7 +182,7 @@ env_parallel() { unset _grep_REGEXP unset _ignore_UNDERSCORE # Test if environment is too big - if `which true` >/dev/null ; then + if `which true` >/dev/null 2>/dev/null ; then `which parallel` "$@"; _parallel_exit_CODE=$? unset PARALLEL_ENV; diff --git a/src/env_parallel.zsh b/src/env_parallel.zsh index f60912f5..00895bf3 100755 --- a/src/env_parallel.zsh +++ b/src/env_parallel.zsh @@ -159,10 +159,24 @@ env_parallel() { unset _list_alias_BODIES unset _list_variable_VALUES unset _list_function_BODIES - `which parallel` "$@"; - _parallel_exit_CODE=$? - unset PARALLEL_ENV; - return $_parallel_exit_CODE + unset _grep_REGEXP + unset _ignore_UNDERSCORE + # Test if environment is too big + if `which /bin/true` >/dev/null 2>/dev/null ; then + `which parallel` "$@"; + _parallel_exit_CODE=$? + unset PARALLEL_ENV; + return $_parallel_exit_CODE + else + unset PARALLEL_ENV; + echo "env_parallel: Error: Your environment is too big." >&2 + echo "env_parallel: Error: Try running this in a clean environment once:" >&2 + echo "env_parallel: Error: env_parallel --record-env" >&2 + echo "env_parallel: Error: And the use '--env _'" >&2 + echo "env_parallel: Error: For details see: man env_parallel" >&2 + + return 255 + fi } parset() { diff --git a/testsuite/tests-to-run/parallel-local-ssh7.sh b/testsuite/tests-to-run/parallel-local-ssh7.sh index 6b92e045..3105cdaa 100755 --- a/testsuite/tests-to-run/parallel-local-ssh7.sh +++ b/testsuite/tests-to-run/parallel-local-ssh7.sh @@ -8,6 +8,51 @@ echo 'but also that they are NOT copied, if ignored' ## par_*_man = tests from the man page # +par_ash_man() { + echo '### ash' + + myscript=$(cat <<'_EOF' + echo "### From man env_parallel" + + . `which env_parallel.ash`; + + 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 + + alias multiline='echo multiline + echo aliases' + env_parallel multiline ::: work + env_parallel -S server multiline ::: work + env_parallel --env multiline multiline ::: work + env_parallel --env multiline -S server multiline ::: work + alias multiline="dummy" + + 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 + + multivar='multiline + variables' + env_parallel echo '"$multivar"' ::: work + env_parallel -S server echo '"$multivar"' ::: work + env_parallel --env multivar echo '"$multivar"' ::: work + env_parallel --env multivar -S server echo '"$multivar"' ::: work + + env_parallel ::: true false true false + echo exit value $? should be 2 + + env_parallel --no-such-option >/dev/null + echo exit value $? should be 255 +_EOF + ) + ssh ash@lo "$myscript" +} + par_bash_man() { echo '### bash' @@ -46,6 +91,13 @@ par_bash_man() { env_parallel --env myvar echo '$myvar' ::: work env_parallel --env myvar -S server echo '$myvar' ::: work + multivar='multiline + variables' + env_parallel echo '"$multivar"' ::: work + env_parallel -S server echo '"$multivar"' ::: work + env_parallel --env multivar echo '"$multivar"' ::: work + env_parallel --env multivar -S server echo '"$multivar"' ::: work + myarray=(arrays work, too) env_parallel -k echo '${myarray[{}]}' ::: 0 1 2 env_parallel -k -S server echo '${myarray[{}]}' ::: 0 1 2 @@ -62,6 +114,261 @@ _EOF ssh bash@lo "$myscript" } +par_csh_man() { + echo '### csh' + myscript=$(cat <<'_EOF' + echo "### From man env_parallel" + +# source `which env_parallel.csh`; + + 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 + + # Functions not supported + + set 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 + + set 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 + + env_parallel ::: true false true false + echo exit value $status should be 2 + + env_parallel --no-such-option >/dev/null + echo exit value $status should be 255 +_EOF + ) + # Sometimes the order f*cks up + stdout ssh csh@lo "$myscript" | sort +} + +par_dash_man() { + echo '### dash' + + myscript=$(cat <<'_EOF' + echo "### From man env_parallel" + + . `which env_parallel.dash`; + + 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 + + alias multiline='echo multiline + echo aliases' + env_parallel multiline ::: work + env_parallel -S server multiline ::: work + env_parallel --env multiline multiline ::: work + env_parallel --env multiline -S server multiline ::: work + alias multiline="dummy" + + 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 + + multivar='multiline + variables' + env_parallel echo '"$multivar"' ::: work + env_parallel -S server echo '"$multivar"' ::: work + env_parallel --env multivar echo '"$multivar"' ::: work + env_parallel --env multivar -S server echo '"$multivar"' ::: work + + env_parallel ::: true false true false + echo exit value $? should be 2 + + env_parallel --no-such-option >/dev/null + echo exit value $? should be 255 +_EOF + ) + ssh dash@lo "$myscript" +} + +par_fish_man() { + echo '### fish' + myscript=$(cat <<'_EOF' + echo "### From man env_parallel" + + 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 + + function myfunc + echo functions $argv + end + env_parallel myfunc ::: work + env_parallel -S server myfunc ::: work + env_parallel --env myfunc myfunc ::: work + env_parallel --env myfunc -S server myfunc ::: work + + set 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 + + set 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 + + env_parallel ::: true false true false + echo exit value $status should be 2 + + env_parallel --no-such-option 2>&1 >/dev/null + echo exit value $status should be 255 +_EOF + ) + ssh fish@lo "$myscript" +} + +par_ksh_man() { + echo '### ksh' + myscript=$(cat <<'_EOF' + echo "### From man env_parallel" + + . `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 + + alias multiline='echo multiline + echo aliases' + env_parallel multiline ::: work + env_parallel -S server multiline ::: work + env_parallel --env multiline multiline ::: work + env_parallel --env multiline -S server multiline ::: work + alias multiline='dummy' + + 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 + + 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 + + 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 + + env_parallel ::: true false true false + echo exit value $? should be 2 + + env_parallel --no-such-option >/dev/null + echo exit value $? should be 255 +_EOF + ) + ssh ksh@lo "$myscript" +} + +par_sh_man() { + echo '### sh' + + myscript=$(cat <<'_EOF' + echo "### From man env_parallel" + + . `which env_parallel.sh`; + + 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 + + alias multiline='echo multiline + echo aliases' + env_parallel multiline ::: work + env_parallel -S server multiline ::: work + env_parallel --env multiline multiline ::: work + env_parallel --env multiline -S server multiline ::: work + alias multiline="dummy" + + 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 + + multivar='multiline + variables' + env_parallel echo '"$multivar"' ::: work + env_parallel -S server echo '"$multivar"' ::: work + env_parallel --env multivar echo '"$multivar"' ::: work + env_parallel --env multivar -S server echo '"$multivar"' ::: work + + env_parallel ::: true false true false + echo exit value $? should be 2 + + env_parallel --no-such-option >/dev/null + echo exit value $? should be 255 +_EOF + ) + ssh sh@lo "$myscript" +} + +par_tcsh_man() { + echo '### tcsh' + myscript=$(cat <<'_EOF' + echo "### From man env_parallel" + +# source `which env_parallel.tcsh` + + 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 + + echo Functions not supported + + set 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 + + set 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 + + env_parallel ::: true false true false + echo exit value $status should be 2 + + env_parallel --no-such-option >/dev/null + echo exit value $status should be 255 +_EOF + ) + ssh -tt tcsh@lo "$myscript" +} + par_zsh_man() { echo '### zsh' myscript=$(cat <<'_EOF' @@ -110,218 +417,55 @@ _EOF ssh zsh@lo "$myscript" } -par_ksh_man() { - echo '### ksh' + +par_ash_underscore() { + echo '### ash' myscript=$(cat <<'_EOF' - echo "### From man env_parallel" + echo "### Testing of --env _" - . `which env_parallel.ksh`; + alias not_copied_alias="echo BAD" +# not_copied_func() { echo BAD; }; + not_copied_var=BAD +# not_copied_array=(BAD BAD BAD); + . `which env_parallel.ash`; + env_parallel --record-env; + alias myecho="echo \$myvar aliases"; +# myfunc() { myecho functions $*; }; + myvar="variables in"; +# myarray=(and arrays in); +# env_parallel myfunc ::: work; +# env_parallel -S server myfunc ::: work; + env_parallel --env myvar,myecho myecho ::: work; + env_parallel --env myvar,myecho -S server myecho ::: work; + env_parallel --env _ myecho ::: work; + env_parallel --env _ -S server myecho ::: work; - 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 - - alias multiline='echo multiline - echo aliases' - env_parallel multiline ::: work - env_parallel -S server multiline ::: work - env_parallel --env multiline multiline ::: work - env_parallel --env multiline -S server multiline ::: work - - 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 - - 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 - - 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 + env_parallel --env _ -S server not_copied_alias ::: error=OK; +# env_parallel --env _ -S server not_copied_func ::: error=OK; + env_parallel --env _ -S server echo \$not_copied_var ::: error=OK; +# env_parallel --env _ -S server echo \${not_copied_array[@]} ::: error=OK; - env_parallel ::: true false true false - echo exit value $? should be 2 - - env_parallel --no-such-option >/dev/null - echo exit value $? should be 255 + echo myvar >> ~/.parallel/ignored_vars; + env_parallel --env _ myecho ::: work; + env_parallel --env _ -S server myecho ::: work; +# echo myarray >> ~/.parallel/ignored_vars; +# env_parallel --env _ myfunc ::: work; +# env_parallel --env _ -S server myfunc ::: work; + echo myecho >> ~/.parallel/ignored_vars; + env_parallel --env _ myecho ::: work; + echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; + env_parallel --env _ -S server myecho ::: work; + echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; +# echo myfunc >> ~/.parallel/ignored_vars; +# env_parallel --env _ myfunc ::: work; +# echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; +# env_parallel --env _ -S server myfunc ::: work; +# echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; _EOF ) - ssh ksh@lo "$myscript" + ssh ash@lo "$myscript" } -_disabled_pdksh_man() { - echo '### pdksh' - myscript=$(cat <<'_EOF' - echo "### From man env_parallel" - - . `which env_parallel.pdksh`; - 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 - - . `which env_parallel.pdksh`; - 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 - - . `which env_parallel.pdksh`; - 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 - - . `which env_parallel.pdksh`; - 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 - - env_parallel ::: true false true false - echo exit value $? should be 2 - - env_parallel --no-such-option >/dev/null - echo exit value $? should be 255 -_EOF - ) - ssh pdksh@lo "$myscript" -} - -par_tcsh_man() { - echo '### tcsh' - myscript=$(cat <<'_EOF' - echo "### From man env_parallel" - -# source `which env_parallel.tcsh` - - 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 - - echo Functions not supported - - set 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 - - set 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 - - env_parallel ::: true false true false - echo exit value $status should be 2 - - env_parallel --no-such-option >/dev/null - echo exit value $status should be 255 -_EOF - ) - ssh -tt tcsh@lo "$myscript" -} - -par_csh_man() { - echo '### csh' - myscript=$(cat <<'_EOF' - echo "### From man env_parallel" - -# source `which env_parallel.csh`; - - 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 - - # Functions not supported - - set 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 - - set 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 - - env_parallel ::: true false true false - echo exit value $status should be 2 - - env_parallel --no-such-option >/dev/null - echo exit value $status should be 255 -_EOF - ) - # Sometimes the order f*cks up - stdout ssh csh@lo "$myscript" | sort -} - -par_fish_man() { - echo '### fish' - myscript=$(cat <<'_EOF' - echo "### From man env_parallel" - - 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 - - function myfunc - echo functions $argv - end - env_parallel myfunc ::: work - env_parallel -S server myfunc ::: work - env_parallel --env myfunc myfunc ::: work - env_parallel --env myfunc -S server myfunc ::: work - - set 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 - - set 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 - - env_parallel ::: true false true false - echo exit value $status should be 2 - - env_parallel --no-such-option 2>&1 >/dev/null - echo exit value $status should be 255 -_EOF - ) - ssh fish@lo "$myscript" -} - - -# -## par_*_underscore = tests with --env _ -# - par_bash_underscore() { echo '### bash' myscript=$(cat <<'_EOF' @@ -371,189 +515,6 @@ _EOF ssh bash@lo "$myscript" } -par_zsh_underscore() { - echo '### zsh' - myscript=$(cat <<'_EOF' - echo "### Testing of --env _" - - . `which env_parallel.zsh`; - - alias not_copied_alias="echo BAD" - not_copied_func() { echo BAD; }; - not_copied_var=BAD - not_copied_array=(BAD BAD BAD); - env_parallel --record-env; - alias myecho="echo \$myvar aliases in"; - eval `cat <<"_EOS"; - myfunc() { myecho ${myarray[@]} functions $*; }; - myvar="variables in"; - myarray=(and arrays in); - env_parallel myfunc ::: work; - env_parallel -S server myfunc ::: work; - env_parallel --env myfunc,myvar,myarray,myecho myfunc ::: work; - env_parallel --env myfunc,myvar,myarray,myecho -S server myfunc ::: work; - env_parallel --env _ myfunc ::: work; - env_parallel --env _ -S server myfunc ::: work; - - env_parallel --env _ -S server not_copied_alias ::: error=OK; - env_parallel --env _ -S server not_copied_func ::: error=OK; - env_parallel --env _ -S server echo \$not_copied_var ::: error=OK; - env_parallel --env _ -S server echo \$\{not_copied_array\[\@\]\} ::: error=OK; - - echo myvar >> ~/.parallel/ignored_vars; - env_parallel --env _ myfunc ::: work; - env_parallel --env _ -S server myfunc ::: work; - echo myarray >> ~/.parallel/ignored_vars; - env_parallel --env _ myfunc ::: work; - env_parallel --env _ -S server myfunc ::: work; - echo myecho >> ~/.parallel/ignored_vars; - : Not using the function, because aliases are expanded in functions; - env_parallel --env _ myecho ::: work; - echo OK if no .^^^^^^^^^^^^^^^^^^^^^^^^^ myecho >&2; - env_parallel --env _ -S server myecho ::: work; - echo OK if no .^^^^^^^^^^^^^^^^^^^^^^^^^ myecho >&2; - echo myfunc >> ~/.parallel/ignored_vars; - env_parallel --env _ myfunc ::: work; - echo OK if no .^^^^^^^^^^^^^^^^^^^^^^^^^ myfunc >&2; - env_parallel --env _ -S server myfunc ::: work; - echo OK if no .^^^^^^^^^^^^^^^^^^^^^^^^^ myfunc >&2; -_EOS` -_EOF - ) - ssh zsh@lo "$myscript" -} - -par_ksh_underscore() { - echo '### ksh' - myscript=$(cat <<'_EOF' - echo "### Testing of --env _" - - alias not_copied_alias="echo BAD" - not_copied_func() { echo BAD; }; - not_copied_var=BAD - not_copied_array=(BAD BAD BAD); - . `which env_parallel.ksh`; - env_parallel --record-env; - alias myecho="echo \$myvar aliases in"; - myfunc() { myecho ${myarray[@]} functions $*; }; - myvar="variables in"; - myarray=(and arrays in); - env_parallel myfunc ::: work; - env_parallel -S server myfunc ::: work; - env_parallel --env myfunc,myvar,myarray,myecho myfunc ::: work; - env_parallel --env myfunc,myvar,myarray,myecho -S server myfunc ::: work; - env_parallel --env _ myfunc ::: work; - env_parallel --env _ -S server myfunc ::: work; - - env_parallel --env _ -S server not_copied_alias ::: error=OK; - env_parallel --env _ -S server not_copied_func ::: error=OK; - env_parallel --env _ -S server echo \$not_copied_var ::: error=OK; - env_parallel --env _ -S server echo \${not_copied_array[@]} ::: error=OK; - - echo myvar >> ~/.parallel/ignored_vars; - env_parallel --env _ myfunc ::: work; - env_parallel --env _ -S server myfunc ::: work; - echo myarray >> ~/.parallel/ignored_vars; - env_parallel --env _ myfunc ::: work; - env_parallel --env _ -S server myfunc ::: work; - echo myecho >> ~/.parallel/ignored_vars; - env_parallel --env _ myfunc ::: work; - echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; - env_parallel --env _ -S server myfunc ::: work; - echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; - echo myfunc >> ~/.parallel/ignored_vars; - env_parallel --env _ myfunc ::: work; - echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; - env_parallel --env _ -S server myfunc ::: work; - echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; -_EOF - ) - ssh ksh@lo "$myscript" -} - -_disabled_pdksh_underscore() { - echo '### pdksh' - myscript=$(cat <<'_EOF' - echo "### Testing of --env _" - - alias not_copied_alias="echo BAD" - not_copied_func() { echo BAD; }; - not_copied_var=BAD - not_copied_array=(BAD BAD BAD); - . `which env_parallel.pdksh`; - env_parallel --record-env; - alias myecho="echo \$myvar aliases in"; - myfunc() { myecho ${myarray[@]} functions $*; }; - myvar="variables in"; - myarray=(and arrays in); - env_parallel myfunc ::: work; - env_parallel -S server myfunc ::: work; - env_parallel --env myfunc,myvar,myarray,myecho myfunc ::: work; - env_parallel --env myfunc,myvar,myarray,myecho -S server myfunc ::: work; - env_parallel --env _ myfunc ::: work; - env_parallel --env _ -S server myfunc ::: work; - - env_parallel --env _ -S server not_copied_alias ::: error=OK; - env_parallel --env _ -S server not_copied_func ::: error=OK; - env_parallel --env _ -S server echo \$not_copied_var ::: error=OK; - env_parallel --env _ -S server echo \${not_copied_array[@]} ::: error=OK; - - echo myvar >> ~/.parallel/ignored_vars; - env_parallel --env _ myfunc ::: work; - env_parallel --env _ -S server myfunc ::: work; - echo myarray >> ~/.parallel/ignored_vars; - env_parallel --env _ myfunc ::: work; - env_parallel --env _ -S server myfunc ::: work; - echo myecho >> ~/.parallel/ignored_vars; - env_parallel --env _ myfunc ::: work; - echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; - env_parallel --env _ -S server myfunc ::: work; - echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; - echo myfunc >> ~/.parallel/ignored_vars; - env_parallel --env _ myfunc ::: work; - echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; - env_parallel --env _ -S server myfunc ::: work; - echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; -_EOF - ) - ssh pdksh@lo "$myscript" -} - -par_tcsh_underscore() { - echo '### tcsh' - myscript=$(cat <<'_EOF' - echo "### Testing of --env _" - -# source `which env_parallel.tcsh`; - - env_parallel --record-env; - alias myecho "echo "\$"myvar "\$'myarray'" aliases"; - set myvar="variables"; - set myarray=(and arrays in); - env_parallel myecho ::: work; - env_parallel -S server myecho ::: work; - env_parallel --env myvar,myarray,myecho myecho ::: work; - env_parallel --env myvar,myarray,myecho -S server myecho ::: work; - env_parallel --env _ myecho ::: work; - env_parallel --env _ -S server myecho ::: work; - - echo myvar >> ~/.parallel/ignored_vars; - env_parallel --env _ myecho ::: work; - env_parallel --env _ -S server myecho ::: work; - alias myecho "echo "\$'myarray'" aliases"; - echo myarray >> ~/.parallel/ignored_vars; - env_parallel --env _ myecho ::: work; - env_parallel --env _ -S server myecho ::: work; - echo myecho >> ~/.parallel/ignored_vars; - env_parallel --env _ myecho ::: work; - echo "OK ^^^^^^^^^^^^^^^^^ if no myecho" >/dev/stderr; - env_parallel --env _ -S server myecho ::: work; - echo "OK ^^^^^^^^^^^^^^^^^ if no myecho" >/dev/stderr; -_EOF - ) - ssh -tt tcsh@lo "$myscript" -} - par_csh_underscore() { echo '### csh' myscript=$(cat <<'_EOF' @@ -589,6 +550,54 @@ _EOF ssh -tt csh@lo "$myscript" } +par_dash_underscore() { + echo '### dash' + myscript=$(cat <<'_EOF' + echo "### Testing of --env _" + + alias not_copied_alias="echo BAD" +# not_copied_func() { echo BAD; }; + not_copied_var=BAD +# not_copied_array=(BAD BAD BAD); + . `which env_parallel.dash`; + env_parallel --record-env; + alias myecho="echo \$myvar aliases"; +# myfunc() { myecho functions $*; }; + myvar="variables in"; +# myarray=(and arrays in); +# env_parallel myfunc ::: work; +# env_parallel -S server myfunc ::: work; + env_parallel --env myvar,myecho myecho ::: work; + env_parallel --env myvar,myecho -S server myecho ::: work; + env_parallel --env _ myecho ::: work; + env_parallel --env _ -S server myecho ::: work; + + env_parallel --env _ -S server not_copied_alias ::: error=OK; +# env_parallel --env _ -S server not_copied_func ::: error=OK; + env_parallel --env _ -S server echo \$not_copied_var ::: error=OK; +# env_parallel --env _ -S server echo \${not_copied_array[@]} ::: error=OK; + + echo myvar >> ~/.parallel/ignored_vars; + env_parallel --env _ myecho ::: work; + env_parallel --env _ -S server myecho ::: work; +# echo myarray >> ~/.parallel/ignored_vars; +# env_parallel --env _ myfunc ::: work; +# env_parallel --env _ -S server myfunc ::: work; + echo myecho >> ~/.parallel/ignored_vars; + env_parallel --env _ myecho ::: work; + echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; + env_parallel --env _ -S server myecho ::: work; + echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; +# echo myfunc >> ~/.parallel/ignored_vars; +# env_parallel --env _ myfunc ::: work; +# echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; +# env_parallel --env _ -S server myfunc ::: work; +# echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; +_EOF + ) + ssh dash@lo "$myscript" +} + par_fish_underscore() { echo '### fish' myscript=$(cat <<'_EOF' @@ -646,11 +655,228 @@ _EOF perl -ne '/fish:|fish\(/ and next; print' } +par_ksh_underscore() { + echo '### ksh' + myscript=$(cat <<'_EOF' + echo "### Testing of --env _" + + alias not_copied_alias="echo BAD" + not_copied_func() { echo BAD; }; + not_copied_var=BAD + not_copied_array=(BAD BAD BAD); + . `which env_parallel.ksh`; + env_parallel --record-env; + alias myecho="echo \$myvar aliases in"; + myfunc() { myecho ${myarray[@]} functions $*; }; + myvar="variables in"; + myarray=(and arrays in); + env_parallel myfunc ::: work; + env_parallel -S server myfunc ::: work; + env_parallel --env myfunc,myvar,myarray,myecho myfunc ::: work; + env_parallel --env myfunc,myvar,myarray,myecho -S server myfunc ::: work; + env_parallel --env _ myfunc ::: work; + env_parallel --env _ -S server myfunc ::: work; + + env_parallel --env _ -S server not_copied_alias ::: error=OK; + env_parallel --env _ -S server not_copied_func ::: error=OK; + env_parallel --env _ -S server echo \$not_copied_var ::: error=OK; + env_parallel --env _ -S server echo \${not_copied_array[@]} ::: error=OK; + + echo myvar >> ~/.parallel/ignored_vars; + env_parallel --env _ myfunc ::: work; + env_parallel --env _ -S server myfunc ::: work; + echo myarray >> ~/.parallel/ignored_vars; + env_parallel --env _ myfunc ::: work; + env_parallel --env _ -S server myfunc ::: work; + echo myecho >> ~/.parallel/ignored_vars; + env_parallel --env _ myfunc ::: work; + echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; + env_parallel --env _ -S server myfunc ::: work; + echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; + echo myfunc >> ~/.parallel/ignored_vars; + env_parallel --env _ myfunc ::: work; + echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; + env_parallel --env _ -S server myfunc ::: work; + echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; +_EOF + ) + ssh ksh@lo "$myscript" +} + +par_sh_underscore() { + echo '### sh' + myscript=$(cat <<'_EOF' + echo "### Testing of --env _" + + alias not_copied_alias="echo BAD" +# not_copied_func() { echo BAD; }; + not_copied_var=BAD +# not_copied_array=(BAD BAD BAD); + . `which env_parallel.sh`; + env_parallel --record-env; + alias myecho="echo \$myvar aliases"; +# myfunc() { myecho functions $*; }; + myvar="variables in"; +# myarray=(and arrays in); +# env_parallel myfunc ::: work; +# env_parallel -S server myfunc ::: work; + env_parallel --env myvar,myecho myecho ::: work; + env_parallel --env myvar,myecho -S server myecho ::: work; + env_parallel --env _ myecho ::: work; + env_parallel --env _ -S server myecho ::: work; + + env_parallel --env _ -S server not_copied_alias ::: error=OK; +# env_parallel --env _ -S server not_copied_func ::: error=OK; + env_parallel --env _ -S server echo \$not_copied_var ::: error=OK; +# env_parallel --env _ -S server echo \${not_copied_array[@]} ::: error=OK; + + echo myvar >> ~/.parallel/ignored_vars; + env_parallel --env _ myecho ::: work; + env_parallel --env _ -S server myecho ::: work; +# echo myarray >> ~/.parallel/ignored_vars; +# env_parallel --env _ myfunc ::: work; +# env_parallel --env _ -S server myfunc ::: work; + echo myecho >> ~/.parallel/ignored_vars; + env_parallel --env _ myecho ::: work; + echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; + env_parallel --env _ -S server myecho ::: work; + echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2; +# echo myfunc >> ~/.parallel/ignored_vars; +# env_parallel --env _ myfunc ::: work; +# echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; +# env_parallel --env _ -S server myfunc ::: work; +# echo "OK if no myfunc ^^^^^^^^^^^^^^^^^" >&2; +_EOF + ) + ssh sh@lo "$myscript" +} + +par_tcsh_underscore() { + echo '### tcsh' + myscript=$(cat <<'_EOF' + echo "### Testing of --env _" + +# source `which env_parallel.tcsh`; + + env_parallel --record-env; + alias myecho "echo "\$"myvar "\$'myarray'" aliases"; + set myvar="variables"; + set myarray=(and arrays in); + env_parallel myecho ::: work; + env_parallel -S server myecho ::: work; + env_parallel --env myvar,myarray,myecho myecho ::: work; + env_parallel --env myvar,myarray,myecho -S server myecho ::: work; + env_parallel --env _ myecho ::: work; + env_parallel --env _ -S server myecho ::: work; + + echo myvar >> ~/.parallel/ignored_vars; + env_parallel --env _ myecho ::: work; + env_parallel --env _ -S server myecho ::: work; + alias myecho "echo "\$'myarray'" aliases"; + echo myarray >> ~/.parallel/ignored_vars; + env_parallel --env _ myecho ::: work; + env_parallel --env _ -S server myecho ::: work; + echo myecho >> ~/.parallel/ignored_vars; + env_parallel --env _ myecho ::: work; + echo "OK ^^^^^^^^^^^^^^^^^ if no myecho" >/dev/stderr; + env_parallel --env _ -S server myecho ::: work; + echo "OK ^^^^^^^^^^^^^^^^^ if no myecho" >/dev/stderr; +_EOF + ) + ssh -tt tcsh@lo "$myscript" +} + +par_zsh_underscore() { + echo '### zsh' + myscript=$(cat <<'_EOF' + echo "### Testing of --env _" + + . `which env_parallel.zsh`; + + alias not_copied_alias="echo BAD" + not_copied_func() { echo BAD; }; + not_copied_var=BAD + not_copied_array=(BAD BAD BAD); + env_parallel --record-env; + alias myecho="echo \$myvar aliases in"; + eval `cat <<"_EOS"; + myfunc() { myecho ${myarray[@]} functions $*; }; + myvar="variables in"; + myarray=(and arrays in); + env_parallel myfunc ::: work; + env_parallel -S server myfunc ::: work; + env_parallel --env myfunc,myvar,myarray,myecho myfunc ::: work; + env_parallel --env myfunc,myvar,myarray,myecho -S server myfunc ::: work; + env_parallel --env _ myfunc ::: work; + env_parallel --env _ -S server myfunc ::: work; + + env_parallel --env _ -S server not_copied_alias ::: error=OK; + env_parallel --env _ -S server not_copied_func ::: error=OK; + env_parallel --env _ -S server echo \$not_copied_var ::: error=OK; + env_parallel --env _ -S server echo \$\{not_copied_array\[\@\]\} ::: error=OK; + + echo myvar >> ~/.parallel/ignored_vars; + env_parallel --env _ myfunc ::: work; + env_parallel --env _ -S server myfunc ::: work; + echo myarray >> ~/.parallel/ignored_vars; + env_parallel --env _ myfunc ::: work; + env_parallel --env _ -S server myfunc ::: work; + echo myecho >> ~/.parallel/ignored_vars; + : Not using the function, because aliases are expanded in functions; + env_parallel --env _ myecho ::: work; + echo OK if no .^^^^^^^^^^^^^^^^^^^^^^^^^ myecho >&2; + env_parallel --env _ -S server myecho ::: work; + echo OK if no .^^^^^^^^^^^^^^^^^^^^^^^^^ myecho >&2; + echo myfunc >> ~/.parallel/ignored_vars; + env_parallel --env _ myfunc ::: work; + echo OK if no .^^^^^^^^^^^^^^^^^^^^^^^^^ myfunc >&2; + env_parallel --env _ -S server myfunc ::: work; + echo OK if no .^^^^^^^^^^^^^^^^^^^^^^^^^ myfunc >&2; +_EOS` +_EOF + ) + ssh zsh@lo "$myscript" +} + + # Test env_parallel: # + for each shell # + remote, locally # + variables, variables with funky content, arrays, assoc array, functions, aliases +par_ash_funky() { + myscript=$(cat <<'_EOF' + . `which env_parallel.ash`; + + myvar="myvar works" + funky=`perl -e "print pack \"c*\", 2..255"` +# Arrays not supported +# myarray=("" array_val2 3 "" 5 " space 6 ") +# typeset -A assocarr +# assocarr[a]=assoc_val_a +# assocarr[b]=assoc_val_b + alias alias_echo="echo 3 arg"; + + func_echo() { + echo $*; + echo "$myvar" +# echo "${myarray[5]}" +# echo ${assocarr[a]} + echo Funky-"$funky"-funky + } + + env_parallel alias_echo ::: alias_works +# env_parallel func_echo ::: function_works + env_parallel -S ash@lo alias_echo ::: alias_works_over_ssh +# env_parallel -S ash@lo func_echo ::: function_works_over_ssh + echo + echo "$funky" | parallel --shellquote +_EOF + ) + # Order is often different. Dunno why. So sort + ssh ash@lo "$myscript" 2>&1 | sort +} + par_bash_funky() { myscript=$(cat <<'_EOF' . `which env_parallel.bash`; @@ -684,96 +910,69 @@ _EOF ssh bash@lo "$myscript" 2>&1 | sort } -par_zsh_funky() { +par_csh_funky() { myscript=$(cat <<'_EOF' + set myvar = "myvar works" + set funky = "`perl -e 'print pack q(c*), 2..255'`" + set myarray = ('' 'array_val2' '3' '' '5' ' space 6 ') + #declare -A assocarr + #assocarr[a]=assoc_val_a + #assocarr[b]=assoc_val_b + alias alias_echo echo 3 arg; + alias alias_echo_var 'echo $argv; echo "$myvar"; echo "${myarray[4]} special chars problem"; echo Funky-"$funky"-funky' - . `which env_parallel.zsh`; + #function func_echo + # echo $argv; + # echo $myvar; + # echo ${myarray[2]} + # #echo ${assocarr[a]} + # echo Funky-"$funky"-funky + #end + + env_parallel alias_echo ::: alias_works + env_parallel alias_echo_var ::: alias_var_works + env_parallel func_echo ::: function_does_not_work + env_parallel -S csh@lo alias_echo ::: alias_works_over_ssh + env_parallel -S csh@lo alias_echo_var ::: alias_var_works_over_ssh + env_parallel -S csh@lo func_echo ::: function_does_not_work_over_ssh + echo + echo "$funky" | parallel --shellquote +_EOF + ) + ssh csh@lo "$myscript" +} + +par_dash_funky() { + myscript=$(cat <<'_EOF' + . `which env_parallel.dash`; myvar="myvar works" - funky=$(perl -e "print pack \"c*\", 1..255") - myarray=("" array_val2 3 "" 5 " space 6 ") - declare -A assocarr - assocarr[a]=assoc_val_a - assocarr[b]=assoc_val_b + funky=`perl -e "print pack \"c*\", 2..255"` +# Arrays not supported +# myarray=("" array_val2 3 "" 5 " space 6 ") +# typeset -A assocarr +# assocarr[a]=assoc_val_a +# assocarr[b]=assoc_val_b alias alias_echo="echo 3 arg"; + func_echo() { echo $*; echo "$myvar" - echo "$myarray[6]" - echo ${assocarr[a]} +# echo "${myarray[5]}" +# echo ${assocarr[a]} echo Funky-"$funky"-funky } + env_parallel alias_echo ::: alias_works - env_parallel func_echo ::: function_works - env_parallel -S zsh@lo alias_echo ::: alias_works_over_ssh - env_parallel -S zsh@lo func_echo ::: function_works_over_ssh +# env_parallel func_echo ::: function_works + env_parallel -S dash@lo alias_echo ::: alias_works_over_ssh +# env_parallel -S dash@lo func_echo ::: function_works_over_ssh echo echo "$funky" | parallel --shellquote _EOF ) # Order is often different. Dunno why. So sort - ssh zsh@lo "$myscript" 2>&1 | sort -} - -par_ksh_funky() { - myscript=$(cat <<'_EOF' - . `which env_parallel.ksh`; - - myvar="myvar works" - funky=$(perl -e "print pack \"c*\", 1..255") - myarray=("" array_val2 3 "" 5 " space 6 ") - typeset -A assocarr - assocarr[a]=assoc_val_a - assocarr[b]=assoc_val_b - alias alias_echo="echo 3 arg"; - - func_echo() { - echo $*; - echo "$myvar" - echo "${myarray[5]}" - echo ${assocarr[a]} - echo Funky-"$funky"-funky - } - - env_parallel alias_echo ::: alias_works - env_parallel func_echo ::: function_works - env_parallel -S ksh@lo alias_echo ::: alias_works_over_ssh - env_parallel -S ksh@lo func_echo ::: function_works_over_ssh - echo - echo "$funky" | parallel --shellquote -_EOF - ) - # Order is often different. Dunno why. So sort - ssh ksh@lo "$myscript" 2>&1 | sort -} - -_disabled_pdksh_funky() { - myscript=$(cat <<'_EOF' - . `which env_parallel.pdksh`; - - myvar="myvar works" - funky=$(perl -e "print pack \"c*\", 1..255") - myarray=("" array_val2 3 "" 5 " space 6 ") - assocarr[a]=assoc_val_a - assocarr[b]=assoc_val_b - alias alias_echo="echo 3 arg"; - func_echo() { - echo $*; - echo "$myvar" - echo "${myarray[5]}" - echo ${assocarr[a]} - echo Funky-"$funky"-funky - } - - env_parallel alias_echo ::: alias_works - env_parallel func_echo ::: function_works - env_parallel -S lo alias_echo ::: alias_works_over_ssh - env_parallel -S lo func_echo ::: function_works_over_ssh - echo - echo "$funky" | parallel --shellquote -_EOF - ) - ssh pdksh@lo "$myscript" + ssh dash@lo "$myscript" 2>&1 | sort } par_fish_funky() { @@ -820,36 +1019,69 @@ _EOF ssh fish@lo "$myscript" } -par_csh_funky() { +par_ksh_funky() { myscript=$(cat <<'_EOF' - set myvar = "myvar works" - set funky = "`perl -e 'print pack q(c*), 2..255'`" - set myarray = ('' 'array_val2' '3' '' '5' ' space 6 ') - #declare -A assocarr - #assocarr[a]=assoc_val_a - #assocarr[b]=assoc_val_b - alias alias_echo echo 3 arg; - alias alias_echo_var 'echo $argv; echo "$myvar"; echo "${myarray[4]} special chars problem"; echo Funky-"$funky"-funky' + . `which env_parallel.ksh`; - #function func_echo - # echo $argv; - # echo $myvar; - # echo ${myarray[2]} - # #echo ${assocarr[a]} - # echo Funky-"$funky"-funky - #end + myvar="myvar works" + funky=$(perl -e "print pack \"c*\", 1..255") + myarray=("" array_val2 3 "" 5 " space 6 ") + typeset -A assocarr + assocarr[a]=assoc_val_a + assocarr[b]=assoc_val_b + alias alias_echo="echo 3 arg"; + + func_echo() { + echo $*; + echo "$myvar" + echo "${myarray[5]}" + echo ${assocarr[a]} + echo Funky-"$funky"-funky + } env_parallel alias_echo ::: alias_works - env_parallel alias_echo_var ::: alias_var_works - env_parallel func_echo ::: function_does_not_work - env_parallel -S csh@lo alias_echo ::: alias_works_over_ssh - env_parallel -S csh@lo alias_echo_var ::: alias_var_works_over_ssh - env_parallel -S csh@lo func_echo ::: function_does_not_work_over_ssh + env_parallel func_echo ::: function_works + env_parallel -S ksh@lo alias_echo ::: alias_works_over_ssh + env_parallel -S ksh@lo func_echo ::: function_works_over_ssh echo echo "$funky" | parallel --shellquote _EOF ) - ssh csh@lo "$myscript" + # Order is often different. Dunno why. So sort + ssh ksh@lo "$myscript" 2>&1 | sort +} + +par_sh_funky() { + myscript=$(cat <<'_EOF' + . `which env_parallel.sh`; + + myvar="myvar works" + funky=`perl -e "print pack \"c*\", 2..255"` +# Arrays not supported +# myarray=("" array_val2 3 "" 5 " space 6 ") +# typeset -A assocarr +# assocarr[a]=assoc_val_a +# assocarr[b]=assoc_val_b + alias alias_echo="echo 3 arg"; + + func_echo() { + echo $*; + echo "$myvar" +# echo "${myarray[5]}" +# echo ${assocarr[a]} + echo Funky-"$funky"-funky + } + + env_parallel alias_echo ::: alias_works +# env_parallel func_echo ::: function_works + env_parallel -S sh@lo alias_echo ::: alias_works_over_ssh +# env_parallel -S sh@lo func_echo ::: function_works_over_ssh + echo + echo "$funky" | parallel --shellquote +_EOF + ) + # Order is often different. Dunno why. So sort + ssh sh@lo "$myscript" 2>&1 | sort } par_tcsh_funky() { @@ -887,6 +1119,62 @@ _EOF ssh tcsh@lo "$myscript" 2>&1 | sort } +par_zsh_funky() { + myscript=$(cat <<'_EOF' + + . `which env_parallel.zsh`; + + myvar="myvar works" + funky=$(perl -e "print pack \"c*\", 1..255") + myarray=("" array_val2 3 "" 5 " space 6 ") + declare -A assocarr + assocarr[a]=assoc_val_a + assocarr[b]=assoc_val_b + alias alias_echo="echo 3 arg"; + func_echo() { + echo $*; + echo "$myvar" + echo "$myarray[6]" + echo ${assocarr[a]} + echo Funky-"$funky"-funky + } + env_parallel alias_echo ::: alias_works + env_parallel func_echo ::: function_works + env_parallel -S zsh@lo alias_echo ::: alias_works_over_ssh + env_parallel -S zsh@lo func_echo ::: function_works_over_ssh + echo + echo "$funky" | parallel --shellquote +_EOF + ) + # Order is often different. Dunno why. So sort + ssh zsh@lo "$myscript" 2>&1 | sort +} + +par_ash_env_parallel() { + myscript=$(cat <<'_EOF' + . `which env_parallel.ash`; + echo 'bug #50435: Remote fifo broke in 20150522' + # Due to $PARALLEL_TMP being transferred + OK=OK + echo data from stdin | env_parallel --pipe -S lo --fifo 'cat {} && echo $OK' + echo data from stdin | env_parallel --pipe -S lo --cat 'cat {} && echo $OK' + + echo 'bug #52534: Tail of multiline alias is ignored' + alias myalias='echo alias line 1 + echo alias line 2 + echo alias line 3 + ' + alias myalias2='echo alias2 line 1 + echo alias2 line 2 + ' + env_parallel myalias ::: myalias2 + env_parallel -S lo myalias ::: myalias2 +_EOF + ) + # Order is often different. Dunno why. So sort + ssh ash@lo "$myscript" 2>&1 | sort +} + par_bash_env_parallel() { myscript=$(cat <<'_EOF' echo 'bug #50435: Remote fifo broke in 20150522' @@ -912,8 +1200,21 @@ _EOF ssh bash@lo "$myscript" 2>&1 | sort } -par_zsh_env_parallel() { +par_csh_env_parallel() { myscript=$(cat <<'_EOF' + echo 'bug #50435: Remote fifo broke in 20150522' + # Due to $PARALLEL_TMP being transferred + set OK=OK + echo data from stdin | env_parallel --pipe -S lo --fifo 'cat {} && echo $OK' + echo data from stdin | env_parallel --pipe -S lo --cat 'cat {} && echo $OK' +_EOF + ) + ssh csh@lo "$myscript" +} + +par_dash_env_parallel() { + myscript=$(cat <<'_EOF' + . `which env_parallel.dash`; echo 'bug #50435: Remote fifo broke in 20150522' # Due to $PARALLEL_TMP being transferred OK=OK @@ -933,7 +1234,19 @@ par_zsh_env_parallel() { _EOF ) # Order is often different. Dunno why. So sort - ssh zsh@lo "$myscript" 2>&1 | sort + ssh dash@lo "$myscript" 2>&1 | sort +} + +par_fish_env_parallel() { + myscript=$(cat <<'_EOF' + echo 'bug #50435: Remote fifo broke in 20150522' + # Due to $PARALLEL_TMP being transferred + set OK OK + echo data from stdin | env_parallel --pipe -S lo --fifo 'cat {}; and echo $OK' + echo data from stdin | env_parallel --pipe -S lo --cat 'cat {}; and echo $OK' +_EOF + ) + ssh fish@lo "$myscript" } par_ksh_env_parallel() { @@ -961,28 +1274,29 @@ _EOF ssh ksh@lo "$myscript" 2>&1 | sort } -par_fish_env_parallel() { +par_sh_env_parallel() { myscript=$(cat <<'_EOF' + . `which env_parallel.sh`; echo 'bug #50435: Remote fifo broke in 20150522' # Due to $PARALLEL_TMP being transferred - set OK OK - echo data from stdin | env_parallel --pipe -S lo --fifo 'cat {}; and echo $OK' - echo data from stdin | env_parallel --pipe -S lo --cat 'cat {}; and echo $OK' -_EOF - ) - ssh fish@lo "$myscript" -} - -par_csh_env_parallel() { - myscript=$(cat <<'_EOF' - echo 'bug #50435: Remote fifo broke in 20150522' - # Due to $PARALLEL_TMP being transferred - set OK=OK + OK=OK echo data from stdin | env_parallel --pipe -S lo --fifo 'cat {} && echo $OK' echo data from stdin | env_parallel --pipe -S lo --cat 'cat {} && echo $OK' + + echo 'bug #52534: Tail of multiline alias is ignored' + alias myalias='echo alias line 1 + echo alias line 2 + echo alias line 3 + ' + alias myalias2='echo alias2 line 1 + echo alias2 line 2 + ' + env_parallel myalias ::: myalias2 + env_parallel -S lo myalias ::: myalias2 _EOF ) - ssh csh@lo "$myscript" + # Order is often different. Dunno why. So sort + ssh sh@lo "$myscript" 2>&1 | sort } par_tcsh_env_parallel() { @@ -998,102 +1312,28 @@ _EOF ssh tcsh@lo "$myscript" 2>&1 | sort } -par_bash_environment_too_big() { +par_zsh_env_parallel() { myscript=$(cat <<'_EOF' - echo 'bug #50815: env_parallel should warn if the environment is too big' - . `which env_parallel.bash`; + echo 'bug #50435: Remote fifo broke in 20150522' + # Due to $PARALLEL_TMP being transferred + OK=OK + echo data from stdin | env_parallel --pipe -S lo --fifo 'cat {} && echo $OK' + echo data from stdin | env_parallel --pipe -S lo --cat 'cat {} && echo $OK' - bigvar="$(perl -e 'print "x"x121000')" - env_parallel echo ::: OK_bigvar - env_parallel -S lo echo ::: OK_bigvar_remote - - bigvar="$(perl -e 'print "\""x60000')" - env_parallel echo ::: OK_bigvar_quote - env_parallel -S lo echo ::: OK_bigvar_quote_remote - - bigvar=u - eval 'bigfunc() { a="'"$(perl -e 'print "x"x121000')"'"; };' - env_parallel echo ::: OK_bigfunc - env_parallel -S lo echo ::: OK_bigfunc_remote - - eval 'bigfunc() { a="'"$(perl -e 'print "\""x121000')"'"; };' - env_parallel echo ::: OK_bigfunc_quote - env_parallel -S lo echo ::: OK_bigfunc_quote_remote - bigfunc() { true; } - - echo Rest should fail - - bigvar="$(perl -e 'print "x"x123000')" - env_parallel echo ::: fail_bigvar - env_parallel -S lo echo ::: fail_bigvar_remote - - bigvar="$(perl -e 'print "\""x61000')" - env_parallel echo ::: fail_bigvar_quote - env_parallel -S lo echo ::: fail_bigvar_quote_remote - - bigvar=u - eval 'bigfunc() { a="'"$(perl -e 'print "x"x1220000')"'"; };' - env_parallel echo ::: fail_bigfunc - env_parallel -S lo echo ::: fail_bigfunc_remote - - eval 'bigfunc() { a="'"$(perl -e 'print "\""x122000')"'"; };' - env_parallel echo ::: fail_bigfunc_quote - env_parallel -S lo echo ::: fail_bigfunc_quote_remote - - bigfunc() { true; } + echo 'bug #52534: Tail of multiline alias is ignored' + alias myalias='echo alias line 1 + echo alias line 2 + echo alias line 3 + ' + alias myalias2='echo alias2 line 1 + echo alias2 line 2 + ' + env_parallel myalias ::: myalias2 + env_parallel -S lo myalias ::: myalias2 _EOF ) - ssh bash@lo "$myscript" -} - -par_dash_environment_too_big() { - myscript=$(cat <<'_EOF' - echo 'bug #50815: env_parallel should warn if the environment is too big' - . `which env_parallel.dash`; - - bigvar="$(perl -e 'print "x"x130000')" - env_parallel echo ::: OK_bigvar - env_parallel -S lo echo ::: OK_bigvar_remote - - bigvar="$(perl -e 'print "\""x65000')" - env_parallel echo ::: OK_bigvar_quote - env_parallel -S lo echo ::: OK_bigvar_quote_remote - -# Functions not supported in dash -# bigvar=u -# eval 'bigfunc() { a="'"$(perl -e 'print "x"x122000')"'"; };' -# env_parallel echo ::: OK_bigfunc -# env_parallel -S lo echo ::: OK_bigfunc_remote -# -# eval 'bigfunc() { a="'"$(perl -e 'print "\""x122000')"'"; };' -# env_parallel echo ::: OK_bigfunc_quote -# env_parallel -S lo echo ::: OK_bigfunc_quote_remote -# bigfunc() { true; } - - echo Rest should fail - - bigvar="$(perl -e 'print "x"x131000')" - env_parallel echo ::: fail_bigvar - env_parallel -S lo echo ::: fail_bigvar_remote - - bigvar="$(perl -e 'print "\""x66000')" - env_parallel echo ::: fail_bigvar_quote - env_parallel -S lo echo ::: fail_bigvar_quote_remote - -# Functions not supported in dash -# bigvar=u -# eval 'bigfunc() { a="'"$(perl -e 'print "x"x1230000')"'"; };' -# env_parallel echo ::: fail_bigfunc -# env_parallel -S lo echo ::: fail_bigfunc_remote -# -# eval 'bigfunc() { a="'"$(perl -e 'print "\""x123000')"'"; };' -# env_parallel echo ::: fail_bigfunc_quote -# env_parallel -S lo echo ::: fail_bigfunc_quote_remote -# -# bigfunc() { true; } -_EOF - ) - ssh dash@lo "$myscript" + # Order is often different. Dunno why. So sort + ssh zsh@lo "$myscript" 2>&1 | sort } par_ash_environment_too_big() { @@ -1146,10 +1386,62 @@ _EOF ssh ash@lo "$myscript" } -par_sh_environment_too_big() { +par_bash_environment_too_big() { myscript=$(cat <<'_EOF' echo 'bug #50815: env_parallel should warn if the environment is too big' - . `which env_parallel.sh`; + . `which env_parallel.bash`; + + bigvar="$(perl -e 'print "x"x121000')" + env_parallel echo ::: OK_bigvar + env_parallel -S lo echo ::: OK_bigvar_remote + + bigvar="$(perl -e 'print "\""x60000')" + env_parallel echo ::: OK_bigvar_quote + env_parallel -S lo echo ::: OK_bigvar_quote_remote + + bigvar=u + eval 'bigfunc() { a="'"$(perl -e 'print "x"x121000')"'"; };' + env_parallel echo ::: OK_bigfunc + env_parallel -S lo echo ::: OK_bigfunc_remote + + eval 'bigfunc() { a="'"$(perl -e 'print "\""x121000')"'"; };' + env_parallel echo ::: OK_bigfunc_quote + env_parallel -S lo echo ::: OK_bigfunc_quote_remote + bigfunc() { true; } + + echo Rest should fail + + bigvar="$(perl -e 'print "x"x123000')" + env_parallel echo ::: fail_bigvar + env_parallel -S lo echo ::: fail_bigvar_remote + + bigvar="$(perl -e 'print "\""x61000')" + env_parallel echo ::: fail_bigvar_quote + env_parallel -S lo echo ::: fail_bigvar_quote_remote + + bigvar=u + eval 'bigfunc() { a="'"$(perl -e 'print "x"x1220000')"'"; };' + env_parallel echo ::: fail_bigfunc + env_parallel -S lo echo ::: fail_bigfunc_remote + + eval 'bigfunc() { a="'"$(perl -e 'print "\""x122000')"'"; };' + env_parallel echo ::: fail_bigfunc_quote + env_parallel -S lo echo ::: fail_bigfunc_quote_remote + + bigfunc() { true; } +_EOF + ) + ssh bash@lo "$myscript" +} + +par_csh_environment_too_big() { + echo Not implemented +} + +par_dash_environment_too_big() { + myscript=$(cat <<'_EOF' + echo 'bug #50815: env_parallel should warn if the environment is too big' + . `which env_parallel.dash`; bigvar="$(perl -e 'print "x"x130000')" env_parallel echo ::: OK_bigvar @@ -1159,7 +1451,7 @@ par_sh_environment_too_big() { env_parallel echo ::: OK_bigvar_quote env_parallel -S lo echo ::: OK_bigvar_quote_remote -# Functions not supported in sh +# Functions not supported in dash # bigvar=u # eval 'bigfunc() { a="'"$(perl -e 'print "x"x122000')"'"; };' # env_parallel echo ::: OK_bigfunc @@ -1180,7 +1472,7 @@ par_sh_environment_too_big() { env_parallel echo ::: fail_bigvar_quote env_parallel -S lo echo ::: fail_bigvar_quote_remote -# Functions not supported in sh +# Functions not supported in dash # bigvar=u # eval 'bigfunc() { a="'"$(perl -e 'print "x"x1230000')"'"; };' # env_parallel echo ::: fail_bigfunc @@ -1193,55 +1485,11 @@ par_sh_environment_too_big() { # bigfunc() { true; } _EOF ) - ssh sh@lo "$myscript" + ssh dash@lo "$myscript" } -par_zsh_environment_too_big() { - myscript=$(cat <<'_EOF' - echo 'bug #50815: env_parallel should warn if the environment is too big' - . `which env_parallel.zsh`; - - bigvar="$(perl -e 'print "x"x120000')" - env_parallel echo ::: OK_bigvar - env_parallel -S lo echo ::: OK_bigvar_remote - - bigvar="$(perl -e 'print "\""x120000')" - env_parallel echo ::: OK_bigvar_quote - env_parallel -S lo echo ::: OK_bigvar_quote_remote - - bigvar=u - eval 'bigfunc() { a="'"$(perl -e 'print "x"x120000')"'"; };' - env_parallel echo ::: OK_bigfunc - env_parallel -S lo echo ::: OK_bigfunc_remote - - eval 'bigfunc() { a="'"$(perl -e 'print "\""x120000')"'"; };' - env_parallel echo ::: OK_bigfunc_quote - env_parallel -S lo echo ::: OK_bigfunc_quote_remote - bigfunc() { true; } - - echo Rest should fail - - bigvar="$(perl -e 'print "x"x121000')" - env_parallel echo ::: fail_bigvar - env_parallel -S lo echo ::: fail_bigvar_remote - - bigvar="$(perl -e 'print "\""x123000')" - env_parallel echo ::: fail_bigvar_quote - env_parallel -S lo echo ::: fail_bigvar_quote_remote - - bigvar=u - eval 'bigfunc() { a="'"$(perl -e 'print "x"x1210000')"'"; };' - env_parallel echo ::: fail_bigfunc - env_parallel -S lo echo ::: fail_bigfunc_remote - - eval 'bigfunc() { a="'"$(perl -e 'print "\""x121000')"'"; };' - env_parallel echo ::: fail_bigfunc_quote - env_parallel -S lo echo ::: fail_bigfunc_quote_remote - - bigfunc() { true; } -_EOF - ) - ssh zsh@lo "$myscript" +par_fish_environment_too_big() { + echo Not implemented } par_ksh_environment_too_big() { @@ -1292,18 +1540,167 @@ _EOF ssh ksh@lo "$myscript" } -par_fish_environment_too_big() { - echo Not implemented -} +par_sh_environment_too_big() { + myscript=$(cat <<'_EOF' + echo 'bug #50815: env_parallel should warn if the environment is too big' + . `which env_parallel.sh`; -par_csh_environment_too_big() { - echo Not implemented + bigvar="$(perl -e 'print "x"x130000')" + env_parallel echo ::: OK_bigvar + env_parallel -S lo echo ::: OK_bigvar_remote + + bigvar="$(perl -e 'print "\""x65000')" + env_parallel echo ::: OK_bigvar_quote + env_parallel -S lo echo ::: OK_bigvar_quote_remote + +# Functions not supported in sh +# bigvar=u +# eval 'bigfunc() { a="'"$(perl -e 'print "x"x122000')"'"; };' +# env_parallel echo ::: OK_bigfunc +# env_parallel -S lo echo ::: OK_bigfunc_remote +# +# eval 'bigfunc() { a="'"$(perl -e 'print "\""x122000')"'"; };' +# env_parallel echo ::: OK_bigfunc_quote +# env_parallel -S lo echo ::: OK_bigfunc_quote_remote +# bigfunc() { true; } + + echo Rest should fail + + bigvar="$(perl -e 'print "x"x131000')" + env_parallel echo ::: fail_bigvar + env_parallel -S lo echo ::: fail_bigvar_remote + + bigvar="$(perl -e 'print "\""x66000')" + env_parallel echo ::: fail_bigvar_quote + env_parallel -S lo echo ::: fail_bigvar_quote_remote + +# Functions not supported in sh +# bigvar=u +# eval 'bigfunc() { a="'"$(perl -e 'print "x"x1230000')"'"; };' +# env_parallel echo ::: fail_bigfunc +# env_parallel -S lo echo ::: fail_bigfunc_remote +# +# eval 'bigfunc() { a="'"$(perl -e 'print "\""x123000')"'"; };' +# env_parallel echo ::: fail_bigfunc_quote +# env_parallel -S lo echo ::: fail_bigfunc_quote_remote +# +# bigfunc() { true; } +_EOF + ) + ssh sh@lo "$myscript" } par_tcsh_environment_too_big() { echo Not implemented } +par_zsh_environment_too_big() { + myscript=$(cat <<'_EOF' + echo 'bug #50815: env_parallel should warn if the environment is too big' + . `which env_parallel.zsh`; + + bigvar="$(perl -e 'print "x"x24000')" + env_parallel echo ::: OK_bigvar + env_parallel -S lo echo ::: OK_bigvar_remote + + bigvar="$(perl -e 'print "\""x24000')" + env_parallel echo ::: OK_bigvar_quote + env_parallel -S lo echo ::: OK_bigvar_quote_remote + + bigvar=u + eval 'bigfunc() { a="'"$(perl -e 'print "x"x24000')"'"; };' + env_parallel echo ::: OK_bigfunc + env_parallel -S lo echo ::: OK_bigfunc_remote + + eval 'bigfunc() { a="'"$(perl -e 'print "\""x24000')"'"; };' + env_parallel echo ::: OK_bigfunc_quote + env_parallel -S lo echo ::: OK_bigfunc_quote_remote + bigfunc() { true; } + + echo Rest should fail + + bigvar="$(perl -e 'print "x"x121000')" + env_parallel echo ::: fail_bigvar + env_parallel -S lo echo ::: fail_bigvar_remote + + bigvar="$(perl -e 'print "\""x121000')" + env_parallel echo ::: fail_bigvar_quote + env_parallel -S lo echo ::: fail_bigvar_quote_remote + + bigvar=u + eval 'bigfunc() { a="'"$(perl -e 'print "x"x121000')"'"; };' + env_parallel echo ::: fail_bigfunc + env_parallel -S lo echo ::: fail_bigfunc_remote + + eval 'bigfunc() { a="'"$(perl -e 'print "\""x121000')"'"; };' + env_parallel echo ::: fail_bigfunc_quote + env_parallel -S lo echo ::: fail_bigfunc_quote_remote + + bigfunc() { true; } +_EOF + ) + ssh zsh@lo "$myscript" +} + +par_ash_parset() { + myscript=$(cat <<'_EOF' + echo 'parset' + . `which env_parallel.ash` + +# Arrays not supported in ash +# echo '### parset into array' +# parset arr1 echo ::: foo bar baz +# echo ${arr1[0]} ${arr1[1]} ${arr1[2]} + + echo '### parset into vars with comma' + parset comma3,comma2,comma1 echo ::: baz bar foo + echo $comma1 $comma2 $comma3 + + echo '### parset into vars with space' + parset 'space3 space2 space1' echo ::: baz bar foo + echo $space1 $space2 $space3 + + echo '### parset with newlines' + parset 'newline3 newline2 newline1' seq ::: 3 2 1 + echo "$newline1" + echo "$newline2" + echo "$newline3" + +# Arrays not supported in ash +# echo '### parset into indexed array vars' +# parset 'myarray[6],myarray[5],myarray[4]' echo ::: baz bar foo +# echo ${myarray[*]} +# echo ${myarray[4]} ${myarray[5]} ${myarray[6]} + + echo '### env_parset' + myfun() { + myecho myfun "$@"; + } + alias myecho='echo myecho "$myvar"' + myvar="myvar" +# Arrays not supported in ash +# myarr=("myarr 0" "myarr 1" "myarr 2") + mynewline="`echo newline1;echo newline2;`" +# Arrays not supported in ash +# env_parset arr1 myfun ::: foo bar baz +# echo "${arr1[0]} ${arr1[1]} ${arr1[2]}" + env_parset comma3,comma2,comma1 myecho ::: baz bar foo + echo "$comma1 $comma2 $comma3" + env_parset 'space3 space2 space1' myecho ::: baz bar foo + echo "$space1 $space2 $space3" + env_parset 'newline3 newline2 newline1' 'echo "$mynewline";seq' ::: 3 2 1 + echo "$newline1" + echo "$newline2" + echo "$newline3" +# Arrays not supported in ash +# env_parset 'myarray[6],myarray[5],myarray[4]' myfun ::: baz bar foo +# echo "${myarray[*]}" +# echo "${myarray[4]} ${myarray[5]} ${myarray[6]}" +_EOF + ) + ssh ash@lo "$myscript" +} + par_bash_parset() { myscript=$(cat <<'_EOF' echo 'parset' @@ -1358,6 +1755,10 @@ _EOF ssh bash@lo "$myscript" } +par_csh_parset() { + echo Not implemented +} + par_dash_parset() { myscript=$(cat <<'_EOF' echo 'parset' @@ -1417,15 +1818,18 @@ _EOF ssh dash@lo "$myscript" } -par_ash_parset() { +par_fish_parset() { + echo Not implemented +} + +par_ksh_parset() { myscript=$(cat <<'_EOF' echo 'parset' - . `which env_parallel.ash` + . `which env_parallel.ksh` -# Arrays not supported in ash -# echo '### parset into array' -# parset arr1 echo ::: foo bar baz -# echo ${arr1[0]} ${arr1[1]} ${arr1[2]} + echo '### parset into array' + parset arr1 echo ::: foo bar baz + echo ${arr1[0]} ${arr1[1]} ${arr1[2]} echo '### parset into vars with comma' parset comma3,comma2,comma1 echo ::: baz bar foo @@ -1441,39 +1845,35 @@ par_ash_parset() { echo "$newline2" echo "$newline3" -# Arrays not supported in ash -# echo '### parset into indexed array vars' -# parset 'myarray[6],myarray[5],myarray[4]' echo ::: baz bar foo -# echo ${myarray[*]} -# echo ${myarray[4]} ${myarray[5]} ${myarray[6]} + echo '### parset into indexed array vars' + parset 'myarray[6],myarray[5],myarray[4]' echo ::: baz bar foo + echo ${myarray[*]} + echo ${myarray[4]} ${myarray[5]} ${myarray[6]} echo '### env_parset' myfun() { myecho myfun "$@"; } - alias myecho='echo myecho "$myvar"' + alias myecho='echo myecho "$myvar" "${myarr[1]}"' myvar="myvar" -# Arrays not supported in ash -# myarr=("myarr 0" "myarr 1" "myarr 2") + myarr=("myarr 0" "myarr 1" "myarr 2") mynewline="`echo newline1;echo newline2;`" -# Arrays not supported in ash -# env_parset arr1 myfun ::: foo bar baz -# echo "${arr1[0]} ${arr1[1]} ${arr1[2]}" - env_parset comma3,comma2,comma1 myecho ::: baz bar foo + env_parset arr1 myfun ::: foo bar baz + echo "${arr1[0]} ${arr1[1]} ${arr1[2]}" + env_parset comma3,comma2,comma1 myfun ::: baz bar foo echo "$comma1 $comma2 $comma3" - env_parset 'space3 space2 space1' myecho ::: baz bar foo + env_parset 'space3 space2 space1' myfum ::: baz bar foo echo "$space1 $space2 $space3" env_parset 'newline3 newline2 newline1' 'echo "$mynewline";seq' ::: 3 2 1 echo "$newline1" echo "$newline2" echo "$newline3" -# Arrays not supported in ash -# env_parset 'myarray[6],myarray[5],myarray[4]' myfun ::: baz bar foo -# echo "${myarray[*]}" -# echo "${myarray[4]} ${myarray[5]} ${myarray[6]}" + env_parset 'myarray[6],myarray[5],myarray[4]' myfun ::: baz bar foo + echo "${myarray[*]}" + echo "${myarray[4]} ${myarray[5]} ${myarray[6]}" _EOF ) - ssh ash@lo "$myscript" + ssh ksh@lo "$myscript" } par_sh_parset() { @@ -1558,6 +1958,10 @@ _EOF ssh sh@lo "$myscript" } +par_tcsh_parset() { + echo Not implemented +} + par_zsh_parset() { myscript=$(cat <<'_EOF' echo 'parset' @@ -1621,74 +2025,8 @@ _EOF ssh zsh@lo "$myscript" } -par_ksh_parset() { - myscript=$(cat <<'_EOF' - echo 'parset' - . `which env_parallel.ksh` - - echo '### parset into array' - parset arr1 echo ::: foo bar baz - echo ${arr1[0]} ${arr1[1]} ${arr1[2]} - - echo '### parset into vars with comma' - parset comma3,comma2,comma1 echo ::: baz bar foo - echo $comma1 $comma2 $comma3 - - echo '### parset into vars with space' - parset 'space3 space2 space1' echo ::: baz bar foo - echo $space1 $space2 $space3 - - echo '### parset with newlines' - parset 'newline3 newline2 newline1' seq ::: 3 2 1 - echo "$newline1" - echo "$newline2" - echo "$newline3" - - echo '### parset into indexed array vars' - parset 'myarray[6],myarray[5],myarray[4]' echo ::: baz bar foo - echo ${myarray[*]} - echo ${myarray[4]} ${myarray[5]} ${myarray[6]} - - echo '### env_parset' - myfun() { - myecho myfun "$@"; - } - alias myecho='echo myecho "$myvar" "${myarr[1]}"' - myvar="myvar" - myarr=("myarr 0" "myarr 1" "myarr 2") - mynewline="`echo newline1;echo newline2;`" - env_parset arr1 myfun ::: foo bar baz - echo "${arr1[0]} ${arr1[1]} ${arr1[2]}" - env_parset comma3,comma2,comma1 myfun ::: baz bar foo - echo "$comma1 $comma2 $comma3" - env_parset 'space3 space2 space1' myfum ::: baz bar foo - echo "$space1 $space2 $space3" - env_parset 'newline3 newline2 newline1' 'echo "$mynewline";seq' ::: 3 2 1 - echo "$newline1" - echo "$newline2" - echo "$newline3" - env_parset 'myarray[6],myarray[5],myarray[4]' myfun ::: baz bar foo - echo "${myarray[*]}" - echo "${myarray[4]} ${myarray[5]} ${myarray[6]}" -_EOF - ) - ssh ksh@lo "$myscript" -} - -par_fish_parset() { - echo Not implemented -} - -par_csh_parset() { - echo Not implemented -} - -par_tcsh_parset() { - echo Not implemented -} - 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 | -compgen -A function | grep par_ | sort -r | +compgen -A function | grep par_ | sort -r | parallel --joblog /tmp/jl-`basename $0` -j200% --tag -k '{} 2>&1' diff --git a/testsuite/tests-to-run/parallel-local-ssh8.sh b/testsuite/tests-to-run/parallel-local-ssh8.sh index bd0606b0..6e991fcd 100644 --- a/testsuite/tests-to-run/parallel-local-ssh8.sh +++ b/testsuite/tests-to-run/parallel-local-ssh8.sh @@ -37,6 +37,7 @@ par_path_remote_csh() { setenv A "`seq 1000`" setenv PATH ${PATH}:/tmp cp /usr/local/bin/env_parallel* /tmp + rehash if ("`alias env_parallel`" == '') then source `which env_parallel.csh` endif diff --git a/testsuite/wanted-results/parallel-local-ssh7 b/testsuite/wanted-results/parallel-local-ssh7 index a9b5d84a..b34c81b5 100644 --- a/testsuite/wanted-results/parallel-local-ssh7 +++ b/testsuite/wanted-results/parallel-local-ssh7 @@ -132,14 +132,46 @@ par_zsh_environment_too_big OK_bigfunc_remote par_zsh_environment_too_big OK_bigfunc_quote par_zsh_environment_too_big OK_bigfunc_quote_remote par_zsh_environment_too_big Rest should fail -par_zsh_environment_too_big env_parallel:135: argument list too long: /usr/local/bin/parallel -par_zsh_environment_too_big env_parallel:135: argument list too long: /usr/local/bin/parallel -par_zsh_environment_too_big env_parallel:135: argument list too long: /usr/local/bin/parallel -par_zsh_environment_too_big env_parallel:135: argument list too long: /usr/local/bin/parallel -par_zsh_environment_too_big env_parallel:135: argument list too long: /usr/local/bin/parallel -par_zsh_environment_too_big env_parallel:135: argument list too long: /usr/local/bin/parallel -par_zsh_environment_too_big env_parallel:135: argument list too long: /usr/local/bin/parallel -par_zsh_environment_too_big env_parallel:135: argument list too long: /usr/local/bin/parallel +par_zsh_environment_too_big env_parallel: Error: Your environment is too big. +par_zsh_environment_too_big env_parallel: Error: Try running this in a clean environment once: +par_zsh_environment_too_big env_parallel: Error: env_parallel --record-env +par_zsh_environment_too_big env_parallel: Error: And the use '--env _' +par_zsh_environment_too_big env_parallel: Error: For details see: man env_parallel +par_zsh_environment_too_big env_parallel: Error: Your environment is too big. +par_zsh_environment_too_big env_parallel: Error: Try running this in a clean environment once: +par_zsh_environment_too_big env_parallel: Error: env_parallel --record-env +par_zsh_environment_too_big env_parallel: Error: And the use '--env _' +par_zsh_environment_too_big env_parallel: Error: For details see: man env_parallel +par_zsh_environment_too_big env_parallel: Error: Your environment is too big. +par_zsh_environment_too_big env_parallel: Error: Try running this in a clean environment once: +par_zsh_environment_too_big env_parallel: Error: env_parallel --record-env +par_zsh_environment_too_big env_parallel: Error: And the use '--env _' +par_zsh_environment_too_big env_parallel: Error: For details see: man env_parallel +par_zsh_environment_too_big env_parallel: Error: Your environment is too big. +par_zsh_environment_too_big env_parallel: Error: Try running this in a clean environment once: +par_zsh_environment_too_big env_parallel: Error: env_parallel --record-env +par_zsh_environment_too_big env_parallel: Error: And the use '--env _' +par_zsh_environment_too_big env_parallel: Error: For details see: man env_parallel +par_zsh_environment_too_big env_parallel: Error: Your environment is too big. +par_zsh_environment_too_big env_parallel: Error: Try running this in a clean environment once: +par_zsh_environment_too_big env_parallel: Error: env_parallel --record-env +par_zsh_environment_too_big env_parallel: Error: And the use '--env _' +par_zsh_environment_too_big env_parallel: Error: For details see: man env_parallel +par_zsh_environment_too_big env_parallel: Error: Your environment is too big. +par_zsh_environment_too_big env_parallel: Error: Try running this in a clean environment once: +par_zsh_environment_too_big env_parallel: Error: env_parallel --record-env +par_zsh_environment_too_big env_parallel: Error: And the use '--env _' +par_zsh_environment_too_big env_parallel: Error: For details see: man env_parallel +par_zsh_environment_too_big env_parallel: Error: Your environment is too big. +par_zsh_environment_too_big env_parallel: Error: Try running this in a clean environment once: +par_zsh_environment_too_big env_parallel: Error: env_parallel --record-env +par_zsh_environment_too_big env_parallel: Error: And the use '--env _' +par_zsh_environment_too_big env_parallel: Error: For details see: man env_parallel +par_zsh_environment_too_big env_parallel: Error: Your environment is too big. +par_zsh_environment_too_big env_parallel: Error: Try running this in a clean environment once: +par_zsh_environment_too_big env_parallel: Error: env_parallel --record-env +par_zsh_environment_too_big env_parallel: Error: And the use '--env _' +par_zsh_environment_too_big env_parallel: Error: For details see: man env_parallel par_zsh_env_parallel OK par_zsh_env_parallel OK par_zsh_env_parallel alias line 1 @@ -260,6 +292,20 @@ par_tcsh_env_parallel OK par_tcsh_env_parallel bug #50435: Remote fifo broke in 20150522 par_tcsh_env_parallel data from stdin par_tcsh_env_parallel data from stdin +par_sh_underscore ### sh +par_sh_underscore ### Testing of --env _ +par_sh_underscore variables in aliases work +par_sh_underscore variables in aliases work +par_sh_underscore variables in aliases work +par_sh_underscore variables in aliases work +par_sh_underscore /bin/sh: 4: not_copied_alias: not found +par_sh_underscore error=OK +par_sh_underscore aliases work +par_sh_underscore aliases work +par_sh_underscore /bin/sh: 2: myecho: not found +par_sh_underscore OK if no myecho ^^^^^^^^^^^^^^^^^ +par_sh_underscore /bin/sh: 2: myecho: not found +par_sh_underscore OK if no myecho ^^^^^^^^^^^^^^^^^ par_sh_parset parset par_sh_parset ### parset into vars with comma par_sh_parset foo bar baz @@ -301,6 +347,40 @@ par_sh_parset newline2 par_sh_parset 1 par_sh_parset 2 par_sh_parset 3 +par_sh_man ### sh +par_sh_man ### From man env_parallel +par_sh_man aliases work +par_sh_man aliases work +par_sh_man aliases work +par_sh_man aliases work +par_sh_man multiline +par_sh_man aliases work +par_sh_man multiline +par_sh_man aliases work +par_sh_man multiline +par_sh_man aliases work +par_sh_man multiline +par_sh_man aliases work +par_sh_man variables work +par_sh_man variables work +par_sh_man variables work +par_sh_man variables work +par_sh_man multiline +par_sh_man variables work +par_sh_man multiline +par_sh_man variables work +par_sh_man multiline +par_sh_man variables work +par_sh_man multiline +par_sh_man variables work +par_sh_man exit value 2 should be 2 +par_sh_man Unknown option: no-such-option +par_sh_man exit value 255 should be 255 +par_sh_funky +par_sh_funky 3 arg alias_works +par_sh_funky 3 arg alias_works_over_ssh +par_sh_funky \\\\\\\\ +par_sh_funky \ \ \ \\\\\\\\\\\\\\ \!\"\#\$%\&\'\(\)\*+,-./0123456789:\;\<\=\>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_\`abcdefghijklmnopqrstuvwxyz\{\|\}\~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ par_sh_environment_too_big bug #50815: env_parallel should warn if the environment is too big par_sh_environment_too_big OK_bigvar par_sh_environment_too_big OK_bigvar_remote @@ -331,6 +411,22 @@ par_sh_environment_too_big env_parallel: Error: Try running this in a clean envi par_sh_environment_too_big env_parallel: Error: env_parallel --record-env par_sh_environment_too_big env_parallel: Error: And the use '--env _' par_sh_environment_too_big env_parallel: Error: For details see: man env_parallel +par_sh_env_parallel OK +par_sh_env_parallel OK +par_sh_env_parallel alias line 1 +par_sh_env_parallel alias line 1 +par_sh_env_parallel alias line 2 +par_sh_env_parallel alias line 2 +par_sh_env_parallel alias line 3 +par_sh_env_parallel alias line 3 +par_sh_env_parallel alias2 line 1 +par_sh_env_parallel alias2 line 1 +par_sh_env_parallel alias2 line 2 +par_sh_env_parallel alias2 line 2 +par_sh_env_parallel bug #50435: Remote fifo broke in 20150522 +par_sh_env_parallel bug #52534: Tail of multiline alias is ignored +par_sh_env_parallel data from stdin +par_sh_env_parallel data from stdin par_ksh_underscore ### ksh par_ksh_underscore ### Testing of --env _ par_ksh_underscore variables in aliases in and arrays in functions work @@ -396,12 +492,24 @@ par_ksh_man aliases work par_ksh_man aliases work par_ksh_man aliases work par_ksh_man aliases work +par_ksh_man env_parallel: Warning: Alias "multiline" contains newline. +par_ksh_man env_parallel: Warning: Make sure the command has at least one newline after "multiline". +par_ksh_man env_parallel: Warning: See BUGS in "man env_parallel". par_ksh_man multiline par_ksh_man aliases work +par_ksh_man env_parallel: Warning: Alias "multiline" contains newline. +par_ksh_man env_parallel: Warning: Make sure the command has at least one newline after "multiline". +par_ksh_man env_parallel: Warning: See BUGS in "man env_parallel". par_ksh_man multiline par_ksh_man aliases work +par_ksh_man env_parallel: Warning: Alias "multiline" contains newline. +par_ksh_man env_parallel: Warning: Make sure the command has at least one newline after "multiline". +par_ksh_man env_parallel: Warning: See BUGS in "man env_parallel". par_ksh_man multiline par_ksh_man aliases work +par_ksh_man env_parallel: Warning: Alias "multiline" contains newline. +par_ksh_man env_parallel: Warning: Make sure the command has at least one newline after "multiline". +par_ksh_man env_parallel: Warning: See BUGS in "man env_parallel". par_ksh_man multiline par_ksh_man aliases work par_ksh_man functions work @@ -454,49 +562,49 @@ par_ksh_environment_too_big OK_bigfunc_remote par_ksh_environment_too_big OK_bigfunc_quote par_ksh_environment_too_big OK_bigfunc_quote_remote par_ksh_environment_too_big Rest should fail -par_ksh_environment_too_big ksh[163]: which: /usr/bin/which: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[170]: which: /usr/bin/which: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: Try running this in a clean environment once: par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And the use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[163]: which: /usr/bin/which: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[170]: which: /usr/bin/which: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: Try running this in a clean environment once: par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And the use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[163]: which: /usr/bin/which: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[170]: which: /usr/bin/which: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: Try running this in a clean environment once: par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And the use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[163]: which: /usr/bin/which: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[170]: which: /usr/bin/which: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: Try running this in a clean environment once: par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And the use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[163]: which: /usr/bin/which: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[170]: which: /usr/bin/which: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: Try running this in a clean environment once: par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And the use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[163]: which: /usr/bin/which: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[170]: which: /usr/bin/which: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: Try running this in a clean environment once: par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And the use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[163]: which: /usr/bin/which: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[170]: which: /usr/bin/which: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: Try running this in a clean environment once: par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env par_ksh_environment_too_big env_parallel: Error: And the use '--env _' par_ksh_environment_too_big env_parallel: Error: For details see: man env_parallel -par_ksh_environment_too_big ksh[163]: which: /usr/bin/which: cannot execute [Argument list too long] +par_ksh_environment_too_big ksh[170]: which: /usr/bin/which: cannot execute [Argument list too long] par_ksh_environment_too_big env_parallel: Error: Your environment is too big. par_ksh_environment_too_big env_parallel: Error: Try running this in a clean environment once: par_ksh_environment_too_big env_parallel: Error: env_parallel --record-env @@ -512,12 +620,22 @@ par_ksh_env_parallel alias line 3 par_ksh_env_parallel alias line 3 par_ksh_env_parallel alias2 line 1 par_ksh_env_parallel alias2 line 1 -par_ksh_env_parallel alias2 line 2 -par_ksh_env_parallel alias2 line 2 par_ksh_env_parallel bug #50435: Remote fifo broke in 20150522 par_ksh_env_parallel bug #52534: Tail of multiline alias is ignored par_ksh_env_parallel data from stdin par_ksh_env_parallel data from stdin +par_ksh_env_parallel env_parallel: Warning: Alias "myalias" contains newline. +par_ksh_env_parallel env_parallel: Warning: Alias "myalias" contains newline. +par_ksh_env_parallel env_parallel: Warning: Alias "myalias2" contains newline. +par_ksh_env_parallel env_parallel: Warning: Alias "myalias2" contains newline. +par_ksh_env_parallel env_parallel: Warning: Make sure the command has at least one newline after "myalias". +par_ksh_env_parallel env_parallel: Warning: Make sure the command has at least one newline after "myalias". +par_ksh_env_parallel env_parallel: Warning: Make sure the command has at least one newline after "myalias2". +par_ksh_env_parallel env_parallel: Warning: Make sure the command has at least one newline after "myalias2". +par_ksh_env_parallel env_parallel: Warning: See BUGS in "man env_parallel". +par_ksh_env_parallel env_parallel: Warning: See BUGS in "man env_parallel". +par_ksh_env_parallel env_parallel: Warning: See BUGS in "man env_parallel". +par_ksh_env_parallel env_parallel: Warning: See BUGS in "man env_parallel". par_fish_underscore ### fish par_fish_underscore ### Testing of --env _ par_fish_underscore variables in aliases and arrays in functions work @@ -621,6 +739,20 @@ par_fish_env_parallel OK par_fish_env_parallel $? is not the exit status. In fish, please use $status. par_fish_env_parallel fish: cat $PARALLEL_TMP; and echo $OK;perl -e '$bash=shift;$csh=shift;for(@ARGV){unlink;rmdir;}if($bash=~s/h//){exit$bash;}exit$csh;' "$?h" "$status" $PARALLEL_TMP par_fish_env_parallel ^ +par_dash_underscore ### dash +par_dash_underscore ### Testing of --env _ +par_dash_underscore variables in aliases work +par_dash_underscore variables in aliases work +par_dash_underscore variables in aliases work +par_dash_underscore variables in aliases work +par_dash_underscore /bin/dash: 4: not_copied_alias: not found +par_dash_underscore error=OK +par_dash_underscore aliases work +par_dash_underscore aliases work +par_dash_underscore /bin/dash: 2: myecho: not found +par_dash_underscore OK if no myecho ^^^^^^^^^^^^^^^^^ +par_dash_underscore /bin/dash: 2: myecho: not found +par_dash_underscore OK if no myecho ^^^^^^^^^^^^^^^^^ par_dash_parset parset par_dash_parset ### parset into vars with comma par_dash_parset foo bar baz @@ -648,6 +780,40 @@ par_dash_parset newline2 par_dash_parset 1 par_dash_parset 2 par_dash_parset 3 +par_dash_man ### dash +par_dash_man ### From man env_parallel +par_dash_man aliases work +par_dash_man aliases work +par_dash_man aliases work +par_dash_man aliases work +par_dash_man multiline +par_dash_man aliases work +par_dash_man multiline +par_dash_man aliases work +par_dash_man multiline +par_dash_man aliases work +par_dash_man multiline +par_dash_man aliases work +par_dash_man variables work +par_dash_man variables work +par_dash_man variables work +par_dash_man variables work +par_dash_man multiline +par_dash_man variables work +par_dash_man multiline +par_dash_man variables work +par_dash_man multiline +par_dash_man variables work +par_dash_man multiline +par_dash_man variables work +par_dash_man exit value 2 should be 2 +par_dash_man Unknown option: no-such-option +par_dash_man exit value 255 should be 255 +par_dash_funky +par_dash_funky 3 arg alias_works +par_dash_funky 3 arg alias_works_over_ssh +par_dash_funky \\\\\\\\ +par_dash_funky \ \ \ \\\\\\\\\\\\\\ \!\"\#\$%\&\'\(\)\*+,-./0123456789:\;\<\=\>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_\`abcdefghijklmnopqrstuvwxyz\{\|\}\~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ par_dash_environment_too_big bug #50815: env_parallel should warn if the environment is too big par_dash_environment_too_big OK_bigvar par_dash_environment_too_big OK_bigvar_remote @@ -678,6 +844,22 @@ par_dash_environment_too_big env_parallel: Error: Try running this in a clean en par_dash_environment_too_big env_parallel: Error: env_parallel --record-env par_dash_environment_too_big env_parallel: Error: And the use '--env _' par_dash_environment_too_big env_parallel: Error: For details see: man env_parallel +par_dash_env_parallel OK +par_dash_env_parallel OK +par_dash_env_parallel alias line 1 +par_dash_env_parallel alias line 1 +par_dash_env_parallel alias line 2 +par_dash_env_parallel alias line 2 +par_dash_env_parallel alias line 3 +par_dash_env_parallel alias line 3 +par_dash_env_parallel alias2 line 1 +par_dash_env_parallel alias2 line 1 +par_dash_env_parallel alias2 line 2 +par_dash_env_parallel alias2 line 2 +par_dash_env_parallel bug #50435: Remote fifo broke in 20150522 +par_dash_env_parallel bug #52534: Tail of multiline alias is ignored +par_dash_env_parallel data from stdin +par_dash_env_parallel data from stdin par_csh_underscore ### csh par_csh_underscore ### Testing of --env _ par_csh_underscore #: Command not found. @@ -873,6 +1055,14 @@ par_bash_man variables work par_bash_man variables work par_bash_man variables work par_bash_man variables work +par_bash_man multiline +par_bash_man variables work +par_bash_man multiline +par_bash_man variables work +par_bash_man multiline +par_bash_man variables work +par_bash_man multiline +par_bash_man variables work par_bash_man arrays par_bash_man work, par_bash_man too @@ -992,6 +1182,20 @@ par_bash_env_parallel env_parallel: Warning: See BUGS in 'man env_parallel'. par_bash_env_parallel env_parallel: Warning: See BUGS in 'man env_parallel'. par_bash_env_parallel env_parallel: Warning: See BUGS in 'man env_parallel'. par_bash_env_parallel env_parallel: Warning: See BUGS in 'man env_parallel'. +par_ash_underscore ### ash +par_ash_underscore ### Testing of --env _ +par_ash_underscore variables in aliases work +par_ash_underscore variables in aliases work +par_ash_underscore variables in aliases work +par_ash_underscore variables in aliases work +par_ash_underscore /bin/ash: 4: not_copied_alias: not found +par_ash_underscore error=OK +par_ash_underscore aliases work +par_ash_underscore aliases work +par_ash_underscore /bin/ash: 2: myecho: not found +par_ash_underscore OK if no myecho ^^^^^^^^^^^^^^^^^ +par_ash_underscore /bin/ash: 2: myecho: not found +par_ash_underscore OK if no myecho ^^^^^^^^^^^^^^^^^ par_ash_parset parset par_ash_parset ### parset into vars with comma par_ash_parset foo bar baz @@ -1019,6 +1223,40 @@ par_ash_parset newline2 par_ash_parset 1 par_ash_parset 2 par_ash_parset 3 +par_ash_man ### ash +par_ash_man ### From man env_parallel +par_ash_man aliases work +par_ash_man aliases work +par_ash_man aliases work +par_ash_man aliases work +par_ash_man multiline +par_ash_man aliases work +par_ash_man multiline +par_ash_man aliases work +par_ash_man multiline +par_ash_man aliases work +par_ash_man multiline +par_ash_man aliases work +par_ash_man variables work +par_ash_man variables work +par_ash_man variables work +par_ash_man variables work +par_ash_man multiline +par_ash_man variables work +par_ash_man multiline +par_ash_man variables work +par_ash_man multiline +par_ash_man variables work +par_ash_man multiline +par_ash_man variables work +par_ash_man exit value 2 should be 2 +par_ash_man Unknown option: no-such-option +par_ash_man exit value 255 should be 255 +par_ash_funky +par_ash_funky 3 arg alias_works +par_ash_funky 3 arg alias_works_over_ssh +par_ash_funky \\\\\\\\ +par_ash_funky \ \ \ \\\\\\\\\\\\\\ \!\"\#\$%\&\'\(\)\*+,-./0123456789:\;\<\=\>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_\`abcdefghijklmnopqrstuvwxyz\{\|\}\~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ par_ash_environment_too_big bug #50815: env_parallel should warn if the environment is too big par_ash_environment_too_big OK_bigvar par_ash_environment_too_big OK_bigvar_remote @@ -1049,3 +1287,19 @@ par_ash_environment_too_big env_parallel: Error: Try running this in a clean env par_ash_environment_too_big env_parallel: Error: env_parallel --record-env par_ash_environment_too_big env_parallel: Error: And the use '--env _' par_ash_environment_too_big env_parallel: Error: For details see: man env_parallel +par_ash_env_parallel OK +par_ash_env_parallel OK +par_ash_env_parallel alias line 1 +par_ash_env_parallel alias line 1 +par_ash_env_parallel alias line 2 +par_ash_env_parallel alias line 2 +par_ash_env_parallel alias line 3 +par_ash_env_parallel alias line 3 +par_ash_env_parallel alias2 line 1 +par_ash_env_parallel alias2 line 1 +par_ash_env_parallel alias2 line 2 +par_ash_env_parallel alias2 line 2 +par_ash_env_parallel bug #50435: Remote fifo broke in 20150522 +par_ash_env_parallel bug #52534: Tail of multiline alias is ignored +par_ash_env_parallel data from stdin +par_ash_env_parallel data from stdin