diff --git a/src/env_parallel.bash b/src/env_parallel.bash index aab5c236..04020090 100755 --- a/src/env_parallel.bash +++ b/src/env_parallel.bash @@ -100,8 +100,9 @@ env_parallel() { export PARALLEL_ENV="$( shopt 2>/dev/null | perl -pe 's:\s+off:;: and s/^/shopt -u /; - s:\s+on:;: and s/^/shopt -s /;'; - echo 'shopt -s expand_aliases 2>/dev/null'; + s:\s+on:;: and s/^/shopt -s /; + s:;$:&>/dev/null;:'; + echo 'shopt -s expand_aliases &>/dev/null'; $_list_alias_BODIES; $_list_variable_VALUES; $_list_function_BODIES)"; diff --git a/src/env_parallel.pod b/src/env_parallel.pod index e4126fbd..2079efc5 100644 --- a/src/env_parallel.pod +++ b/src/env_parallel.pod @@ -127,9 +127,9 @@ E.g. by doing: =item aliases - alias myecho echo - env_parallel myecho ::: test - env_parallel -S server myecho ::: test + 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 @@ -139,18 +139,17 @@ Not supported by B. =item variables - set myvar=test - env_parallel echo "\$myvar" ::: test - env_parallel -S csh@server echo "\$myvar" ::: test + 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 - =item arrays with no special chars - set myarray=(foo bar baz) - env_parallel echo "\${myarray\[\{\}\]}" ::: 1 2 3 - env_parallel -S csh@server echo "\${myarray\[\{\}\]}" ::: 1 2 3 + 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 @@ -410,10 +409,10 @@ E.g. by doing: =item arrays 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 -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 =back diff --git a/src/env_parallel.zsh b/src/env_parallel.zsh index 7238faac..76f4ea81 100755 --- a/src/env_parallel.zsh +++ b/src/env_parallel.zsh @@ -100,11 +100,10 @@ env_parallel() { _list_variable_VALUES="true" fi unset _variable_NAMES - export PARALLEL_ENV="$( - eval $_list_alias_BODIES >/dev/null; - eval $_list_function_BODIES >/dev/null; - eval $_list_variable_VALUES >/dev/null; + eval $_list_alias_BODIES; + eval $_list_function_BODIES; + eval $_list_variable_VALUES; )"; unset _list_alias_BODIES unset _list_variable_VALUES