env_parallel.mksh: Initial version.

This commit is contained in:
Ole Tange 2018-07-13 07:33:11 +02:00
parent dd5fb4a08b
commit 0d5072907d
10 changed files with 1038 additions and 21 deletions

View file

@ -1,8 +1,8 @@
bin_SCRIPTS = parallel sql niceload parcat parset env_parallel \ bin_SCRIPTS = parallel sql niceload parcat parset env_parallel \
env_parallel.ash env_parallel.bash env_parallel.csh \ env_parallel.ash env_parallel.bash env_parallel.csh \
env_parallel.dash env_parallel.fish env_parallel.ksh \ env_parallel.dash env_parallel.fish env_parallel.ksh \
env_parallel.pdksh env_parallel.sh env_parallel.tcsh \ env_parallel.mksh env_parallel.pdksh env_parallel.sh \
env_parallel.zsh env_parallel.tcsh env_parallel.zsh
install-exec-hook: install-exec-hook:
rm $(DESTDIR)$(bindir)/sem || true rm $(DESTDIR)$(bindir)/sem || true
@ -278,8 +278,8 @@ DISTCLEANFILES = parallel.1 env_parallel.1 sem.1 sql.1 niceload.1 \
EXTRA_DIST = parallel sem sql niceload parcat parset env_parallel \ EXTRA_DIST = parallel sem sql niceload parcat parset env_parallel \
env_parallel.ash env_parallel.bash env_parallel.csh \ env_parallel.ash env_parallel.bash env_parallel.csh \
env_parallel.dash env_parallel.fish env_parallel.ksh \ env_parallel.dash env_parallel.fish env_parallel.ksh \
env_parallel.pdksh env_parallel.sh env_parallel.tcsh \ env_parallel.mksh env_parallel.pdksh env_parallel.sh \
env_parallel.zsh parcat.pod parset.pod sem.pod parallel.pod \ env_parallel.tcsh env_parallel.zsh parcat.pod parset.pod \
env_parallel.pod niceload.pod parallel_tutorial.pod \ sem.pod parallel.pod env_parallel.pod niceload.pod \
parallel_book.pod parallel_design.pod \ parallel_tutorial.pod parallel_book.pod parallel_design.pod \
parallel_alternatives.pod $(DISTCLEANFILES) parallel_alternatives.pod $(DISTCLEANFILES)

View file

@ -232,8 +232,8 @@ top_srcdir = @top_srcdir@
bin_SCRIPTS = parallel sql niceload parcat parset env_parallel \ bin_SCRIPTS = parallel sql niceload parcat parset env_parallel \
env_parallel.ash env_parallel.bash env_parallel.csh \ env_parallel.ash env_parallel.bash env_parallel.csh \
env_parallel.dash env_parallel.fish env_parallel.ksh \ env_parallel.dash env_parallel.fish env_parallel.ksh \
env_parallel.pdksh env_parallel.sh env_parallel.tcsh \ env_parallel.mksh env_parallel.pdksh env_parallel.sh \
env_parallel.zsh env_parallel.tcsh env_parallel.zsh
@DOCUMENTATION_TRUE@man_MANS = parallel.1 env_parallel.1 sem.1 sql.1 niceload.1 \ @DOCUMENTATION_TRUE@man_MANS = parallel.1 env_parallel.1 sem.1 sql.1 niceload.1 \
@DOCUMENTATION_TRUE@ parallel_tutorial.7 parallel_book.7 parallel_design.7 \ @DOCUMENTATION_TRUE@ parallel_tutorial.7 parallel_book.7 parallel_design.7 \
@ -269,10 +269,10 @@ DISTCLEANFILES = parallel.1 env_parallel.1 sem.1 sql.1 niceload.1 \
EXTRA_DIST = parallel sem sql niceload parcat parset env_parallel \ EXTRA_DIST = parallel sem sql niceload parcat parset env_parallel \
env_parallel.ash env_parallel.bash env_parallel.csh \ env_parallel.ash env_parallel.bash env_parallel.csh \
env_parallel.dash env_parallel.fish env_parallel.ksh \ env_parallel.dash env_parallel.fish env_parallel.ksh \
env_parallel.pdksh env_parallel.sh env_parallel.tcsh \ env_parallel.mksh env_parallel.pdksh env_parallel.sh \
env_parallel.zsh parcat.pod parset.pod sem.pod parallel.pod \ env_parallel.tcsh env_parallel.zsh parcat.pod parset.pod \
env_parallel.pod niceload.pod parallel_tutorial.pod \ sem.pod parallel.pod env_parallel.pod niceload.pod \
parallel_book.pod parallel_design.pod \ parallel_tutorial.pod parallel_book.pod parallel_design.pod \
parallel_alternatives.pod $(DISTCLEANFILES) parallel_alternatives.pod $(DISTCLEANFILES)
all: all-am all: all-am

View file

@ -43,6 +43,7 @@ while test $# -gt 0; do
installer . env_parallel.sh $HOME/.shrc installer . env_parallel.sh $HOME/.shrc
installer . env_parallel.zsh $HOME/.zshenv installer . env_parallel.zsh $HOME/.zshenv
installer source env_parallel.ksh $HOME/.kshrc installer source env_parallel.ksh $HOME/.kshrc
installer source env_parallel.mksh $HOME/.mkshrc
echo $SHELL | grepq /pdksh && echo $SHELL | grepq /pdksh &&
installer . env_parallel.pdksh $HOME/.profile installer . env_parallel.pdksh $HOME/.profile
echo $SHELL | grepq /ash && echo $SHELL | grepq /ash &&
@ -60,6 +61,7 @@ while test $# -gt 0; do
echo " " $HOME/.zshenv echo " " $HOME/.zshenv
echo " " $HOME/.config/fish/config.fish echo " " $HOME/.config/fish/config.fish
echo " " $HOME/.kshrc echo " " $HOME/.kshrc
echo " " $HOME/.mkshrc
echo " " $HOME/.profile echo " " $HOME/.profile
echo " " $HOME/.cshrc echo " " $HOME/.cshrc
echo " " $HOME/.tcshrc echo " " $HOME/.tcshrc
@ -94,6 +96,10 @@ ksh: Put this in $HOME/.kshrc: source `which env_parallel.ksh`
E.g. by doing: echo 'source `which env_parallel.ksh`' >> $HOME/.kshrc E.g. by doing: echo 'source `which env_parallel.ksh`' >> $HOME/.kshrc
Supports: aliases, functions, variables, arrays Supports: aliases, functions, variables, arrays
mksh: Put this in $HOME/.mkshrc: source `which env_parallel.mksh`
E.g. by doing: echo 'source `which env_parallel.mksh`' >> $HOME/.mkshrc
Supports: aliases, functions, variables, arrays
pdksh: Put this in $HOME/.profile: source `which env_parallel.pdksh` pdksh: Put this in $HOME/.profile: source `which env_parallel.pdksh`
E.g. by doing: echo '. `which env_parallel.pdksh`' >> $HOME/.profile E.g. by doing: echo '. `which env_parallel.pdksh`' >> $HOME/.profile
Supports: aliases, functions, variables, arrays Supports: aliases, functions, variables, arrays

357
src/env_parallel.mksh Normal file
View file

@ -0,0 +1,357 @@
#!/usr/bin/env ksh
# This file must be sourced in mksh:
#
# source `which env_parallel.mksh`
#
# after which 'env_parallel' works
#
#
# Copyright (C) 2016,2017,2018
# Ole Tange and Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>
# or write to the Free Software Foundation, Inc., 51 Franklin St,
# Fifth Floor, Boston, MA 02110-1301 USA
env_parallel() {
# env_parallel.mksh
_names_of_ALIASES() {
alias | perl -pe 's/=.*//'
}
_bodies_of_ALIASES() {
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
}
_names_of_FUNCTIONS() {
typeset +f
}
_bodies_of_FUNCTIONS() {
typeset -f "$@"
}
_names_of_VARIABLES() {
typeset +p |
perl -pe 's/^(type)?set( [-+][a-zA-Z0-9]*)* //; s/(\[\d+\])?=.*//' |
uniq
}
_bodies_of_VARIABLES() {
typeset -p "$@"
}
_ignore_HARDCODED() {
# These names cannot be detected
echo '(_)'
}
_ignore_READONLY() {
readonly | perl -e '@r = map {
chomp;
# sh on UnixWare: readonly TIMEOUT
# ash: readonly var='val'
# ksh: var='val'
# mksh: PIPESTATUS[0]
s/^(readonly )?([^=\[ ]*?)(\[\d+\])?(=.*|)$/$2/ or
# bash: declare -ar BASH_VERSINFO=([0]="4" [1]="4")
s/^\S+\s+\S+\s+(\S[^=]*)(=.*|$)/$1/;
$_ } <>;
$vars = join "|",map { quotemeta $_ } @r;
print $vars ? "($vars)" : "(,,nO,,VaRs,,)";
'
}
_remove_bad_NAMES() {
# Do not transfer vars and funcs from env_parallel
_ignore_RO="`_ignore_READONLY`"
_ignore_HARD="`_ignore_HARDCODED`"
# Macos-grep does not like long patterns
# Old Solaris grep does not support -E
# Perl Version of:
# grep -Ev '^(...)$' |
perl -ne '/^(
PARALLEL_ENV|
PARALLEL_TMP|
_alias_NAMES|
_bodies_of_ALIASES|
_bodies_of_FUNCTIONS|
_bodies_of_VARIABLES|
_error_PAR|
_function_NAMES|
_get_ignored_VARS|
_grep_REGEXP|
_ignore_HARD|
_ignore_HARDCODED|
_ignore_READONLY|
_ignore_RO|
_ignore_UNDERSCORE|
_list_alias_BODIES|
_list_function_BODIES|
_list_variable_VALUES|
_make_grep_REGEXP|
_names_of_ALIASES|
_names_of_FUNCTIONS|
_names_of_VARIABLES|
_names_of_maybe_FUNCTIONS|
_parallel_exit_CODE|
_prefix_PARALLEL_ENV|
_prefix_PARALLEL_ENV|
_remove_bad_NAMES|
_remove_readonly|
_variable_NAMES|
_warning_PAR|
_which_PAR)$/x and next;
# Filter names matching --env
/^'"$_grep_REGEXP"'$/ or next;
/^'"$_ignore_UNDERSCORE"'$/ and next;
# Remove readonly variables
/^'"$_ignore_RO"'$/ and next;
/^'"$_ignore_HARD"'$/ and next;
print;'
}
_get_ignored_VARS() {
perl -e '
for(@ARGV){
$next_is_env and push @envvar, split/,/, $_;
$next_is_env=/^--env$/;
}
if(grep { /^_$/ } @envvar) {
if(not open(IN, "<", "$ENV{HOME}/.parallel/ignored_vars")) {
print STDERR "parallel: Error: ",
"Run \"parallel --record-env\" in a clean environment first.\n";
} else {
chomp(@ignored_vars = <IN>);
}
}
if($ENV{PARALLEL_IGNORED_NAMES}) {
push @ignored_vars, split/\s+/, $ENV{PARALLEL_IGNORED_NAMES};
chomp @ignored_vars;
}
$vars = join "|",map { quotemeta $_ } "env_parallel", @ignored_vars;
print $vars ? "($vars)" : "(,,nO,,VaRs,,)";
' -- "$@"
}
# Get the --env variables if set
# --env _ should be ignored
# and convert a b c to (a|b|c)
# If --env not set: Match everything (.*)
_make_grep_REGEXP() {
perl -e '
for(@ARGV){
/^_$/ and $next_is_env = 0;
$next_is_env and push @envvar, split/,/, $_;
$next_is_env = /^--env$/;
}
$vars = join "|",map { quotemeta $_ } @envvar;
print $vars ? "($vars)" : "(.*)";
' -- "$@"
}
_which_PAR() {
# type returns:
# ll is an alias for ls -l (in ash)
# bash is a tracked alias for /bin/bash
# true is a shell builtin
# myfunc is a function (in bash)
# myfunc is a shell function (in zsh)
# which is /usr/bin/which
# which is hashed (/usr/bin/which)
# aliased to `alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
# Return 0 if found, 1 otherwise
LANG=C type "$@" |
perl -pe '$exit += (s/ is an alias for .*// ||
s/ is aliased to .*// ||
s/ is a function// ||
s/ is a shell function// ||
s/ is a shell builtin// ||
s/.* is hashed .(\S+).$/$1/ ||
s/.* is (a tracked alias for )?//);
END { exit not $exit }'
}
_warning_PAR() {
echo "env_parallel: Warning: $@" >&2
}
_error_PAR() {
echo "env_parallel: Error: $@" >&2
}
if _which_PAR parallel >/dev/null; then
true parallel found in path
else
_error_PAR 'parallel must be in $PATH.'
return 255
fi
# Grep regexp for vars given by --env
_grep_REGEXP="`_make_grep_REGEXP \"$@\"`"
# Deal with --env _
_ignore_UNDERSCORE="`_get_ignored_VARS \"$@\"`"
# --record-env
if perl -e 'exit grep { /^--record-env$/ } @ARGV' -- "$@"; then
true skip
else
(_names_of_ALIASES;
_names_of_FUNCTIONS;
_names_of_VARIABLES) |
cat > $HOME/.parallel/ignored_vars
return 0
fi
# --session
if perl -e 'exit grep { /^--session$/ } @ARGV' -- "$@"; then
true skip
else
PARALLEL_IGNORED_NAMES="`_names_of_ALIASES;
_names_of_FUNCTIONS;
_names_of_VARIABLES`"
export PARALLEL_IGNORED_NAMES
return 0
fi
# Grep alias 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
_list_alias_BODIES="true"
fi
unset _alias_NAMES
# Grep function 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
_list_function_BODIES="true"
fi
unset _function_NAMES
# Grep variable 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
_list_variable_VALUES="true"
fi
unset _variable_NAMES
PARALLEL_ENV="`
$_list_alias_BODIES;
$_list_function_BODIES;
$_list_variable_VALUES;
`"
export PARALLEL_ENV
unset _list_alias_BODIES
unset _list_variable_VALUES
unset _list_function_BODIES
unset _grep_REGEXP
unset _ignore_UNDERSCORE
# Test if environment is too big
if `_which_PAR true` >/dev/null 2>/dev/null ; then
parallel "$@";
_parallel_exit_CODE=$?
unset PARALLEL_ENV;
return $_parallel_exit_CODE
else
unset PARALLEL_ENV;
_error_PAR "Your environment is too big."
_error_PAR "You can try 3 different approaches:"
_error_PAR "1. Run 'env_parallel --session' before you set"
_error_PAR " variables or define functions."
_error_PAR "2. Use --env and only mention the names to copy."
_error_PAR "3. Try running this in a clean environment once:"
_error_PAR " env_parallel --record-env"
_error_PAR " And then use '--env _'"
_error_PAR "For details see: man env_parallel"
return 255
fi
}
parset() {
_parset_parallel_prg=parallel
_parset_main "$@"
}
env_parset() {
_parset_parallel_prg=env_parallel
_parset_main "$@"
}
_parset_main() {
# If $1 contains ',' or space:
# Split on , to get the destination variable names
# If $1 is a single destination variable name:
# Treat it as the name of an array
#
# # Create array named myvar
# parset myvar echo ::: {1..10}
# echo ${myvar[5]}
#
# # Put output into $var_a $var_b $var_c
# varnames=(var_a var_b var_c)
# parset "${varnames[*]}" echo ::: {1..3}
# echo $var_c
#
# # Put output into $var_a4 $var_b4 $var_c4
# parset "var_a4 var_b4 var_c4" echo ::: {1..3}
# echo $var_c4
_parset_name="$1"
if [ "$_parset_name" = "" ] ; then
echo parset: Error: No destination variable given. >&2
echo parset: Error: Try: >&2
echo parset: Error: ' ' parset myarray echo ::: foo bar >&2
return 255
fi
shift
echo "$_parset_name" |
perl -ne 'chomp;for (split /[, ]/) {
# Allow: var_32 var[3]
if(not /^[a-zA-Z_][a-zA-Z_0-9]*(\[\d+\])?$/) {
print STDERR "parset: Error: $_ is an invalid variable name.\n";
print STDERR "parset: Error: Variable names must be letter followed by letters or digits.\n";
$exitval = 255;
}
}
exit $exitval;
' || return 255
if perl -e 'exit not grep /,| /, @ARGV' "$_parset_name" ; then
# $_parset_name contains , or space
# Split on , or space to get the names
eval "`
# Compute results into files
$_parset_parallel_prg --files -k "$@" |
# var1= cat tmpfile1; rm tmpfile1
# var2= cat tmpfile2; rm tmpfile2
parallel -q echo {2}='\`cat {1}; rm {1}\`' :::: - :::+ \`
echo "$_parset_name" |
perl -pe 's/,/ /g'
\`
`"
else
# $_parset_name does not contain , or space
# => $_parset_name is the name of the array to put data into
# Supported in: bash zsh ksh
# Arrays do not work in: ash dash
eval "$_parset_name=( $( $_parset_parallel_prg --files -k "$@" |
perl -pe 'chop;$_="\"\`cat $_; rm $_\`\" "' ) )"
fi
}

View file

@ -448,6 +448,68 @@ array with the given name. Multiple B<--env>s can be given.
=back =back
=head2 mksh (alpha testing)
=head3 Installation
Put this in $HOME/.mkshrc:
source `which env_parallel.mksh`
E.g. by doing:
echo 'source `which env_parallel.mksh`' >> $HOME/.mkshrc
=head3 Supported use
B<--env> is supported to export only the variable, alias, function, or
array with the given name. Multiple B<--env>s can be given.
=over 8
=item aliases
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
=item functions
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
=item variables
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
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
=back
=head2 pdksh =head2 pdksh
=head3 Installation =head3 Installation

View file

@ -43,6 +43,7 @@ while test $# -gt 0; do
installer . env_parallel.sh $HOME/.shrc installer . env_parallel.sh $HOME/.shrc
installer . env_parallel.zsh $HOME/.zshenv installer . env_parallel.zsh $HOME/.zshenv
installer source env_parallel.ksh $HOME/.kshrc installer source env_parallel.ksh $HOME/.kshrc
installer source env_parallel.mksh $HOME/.kshrc
echo $SHELL | grepq /pdksh && echo $SHELL | grepq /pdksh &&
installer . env_parallel.pdksh $HOME/.profile installer . env_parallel.pdksh $HOME/.profile
echo $SHELL | grepq /ash && echo $SHELL | grepq /ash &&
@ -60,6 +61,7 @@ while test $# -gt 0; do
echo " " $HOME/.zshenv echo " " $HOME/.zshenv
echo " " $HOME/.config/fish/config.fish echo " " $HOME/.config/fish/config.fish
echo " " $HOME/.kshrc echo " " $HOME/.kshrc
echo " " $HOME/.mkshrc
echo " " $HOME/.profile echo " " $HOME/.profile
echo " " $HOME/.cshrc echo " " $HOME/.cshrc
echo " " $HOME/.tcshrc echo " " $HOME/.tcshrc
@ -93,6 +95,10 @@ ksh: Put this in $HOME/.kshrc: source `which env_parallel.ksh`
E.g. by doing: echo 'source `which env_parallel.ksh`' >> $HOME/.kshrc E.g. by doing: echo 'source `which env_parallel.ksh`' >> $HOME/.kshrc
Supports: aliases, functions, variables, arrays Supports: aliases, functions, variables, arrays
mksh: Put this in $HOME/.mkshrc: source `which env_parallel.mksh`
E.g. by doing: echo 'source `which env_parallel.mksh`' >> $HOME/.mkshrc
Supports: aliases, functions, variables, arrays
pdksh: Put this in $HOME/.profile: source `which env_parallel.pdksh` pdksh: Put this in $HOME/.profile: source `which env_parallel.pdksh`
E.g. by doing: echo '. `which env_parallel.pdksh`' >> $HOME/.profile E.g. by doing: echo '. `which env_parallel.pdksh`' >> $HOME/.profile
Supports: aliases, functions, variables, arrays Supports: aliases, functions, variables, arrays

View file

@ -39,7 +39,7 @@ variable.
=head1 SUPPORTED SHELLS =head1 SUPPORTED SHELLS
=head2 Bash/Zsh/Ksh =head2 Bash/Zsh/Ksh/(Mksh alpha testing)
=head3 Examples =head3 Examples

View file

@ -346,6 +346,69 @@ _EOF
ssh ksh@lo "$myscript" ssh ksh@lo "$myscript"
} }
par_mksh_man() {
echo '### mksh'
myscript=$(cat <<'_EOF'
echo "### From man env_parallel"
. `which env_parallel.mksh`;
alias myecho='echo aliases with \= \& \" \!'" \'"
myecho work
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 with \= \& \" \!'" \'"
multiline work
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 'with = & " !'" '" $*; }
myfunc work
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 with = & " !'" '"
echo "$myvar" work
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 with = & " !'" '"
echo "$multivar" work
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 'with = & " !'" '" work, too)
echo "${myarray[0]}" "${myarray[1]}" "${myarray[2]}" "${myarray[3]}"
env_parallel -k echo '"${myarray[{}]}"' ::: 0 1 2 3
env_parallel -k -S server echo '"${myarray[{}]}"' ::: 0 1 2 3
env_parallel -k --env myarray echo '"${myarray[{}]}"' ::: 0 1 2 3
env_parallel -k --env myarray -S server echo '"${myarray[{}]}"' ::: 0 1 2 3
env_parallel ::: true false true false
echo exit value $? should be 2
env_parallel --no-such-option 2>&1 >/dev/null
# Sleep 1 to delay output to stderr to avoid race
echo exit value $? should be 255 `sleep 1`
_EOF
)
ssh mksh@lo "$myscript"
}
par_sh_man() { par_sh_man() {
echo '### sh' echo '### sh'
@ -796,6 +859,54 @@ _EOF
ssh ksh@lo "$myscript" ssh ksh@lo "$myscript"
} }
par_mksh_underscore() {
echo '### mksh'
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.mksh`;
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 mksh@lo "$myscript"
}
par_sh_underscore() { par_sh_underscore() {
echo '### sh' echo '### sh'
myscript=$(cat <<'_EOF' myscript=$(cat <<'_EOF'
@ -1144,6 +1255,39 @@ _EOF
ssh ksh@lo "$myscript" 2>&1 | sort ssh ksh@lo "$myscript" 2>&1 | sort
} }
par_mksh_funky() {
myscript=$(cat <<'_EOF'
. `which env_parallel.mksh`;
myvar="myvar works"
funky=$(perl -e "print pack \"c*\", 1..255")
myarray=("" array_val2 3 "" 5 " space 6 ")
# Assoc arrays not supported
# 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 mksh@lo alias_echo ::: alias_works_over_ssh
env_parallel -S mksh@lo func_echo ::: function_works_over_ssh
echo
echo "$funky" | parallel --shellquote
_EOF
)
# Order is often different. Dunno why. So sort
ssh mksh@lo "$myscript" 2>&1 | sort
}
par_sh_funky() { par_sh_funky() {
myscript=$(cat <<'_EOF' myscript=$(cat <<'_EOF'
. `which env_parallel.sh`; . `which env_parallel.sh`;
@ -1367,6 +1511,31 @@ _EOF
ssh ksh@lo "$myscript" 2>&1 | sort ssh ksh@lo "$myscript" 2>&1 | sort
} }
par_mksh_env_parallel() {
myscript=$(cat <<'_EOF'
. `which env_parallel.mksh`;
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 mksh@lo "$myscript" 2>&1 | sort
}
par_sh_env_parallel() { par_sh_env_parallel() {
myscript=$(cat <<'_EOF' myscript=$(cat <<'_EOF'
. `which env_parallel.sh`; . `which env_parallel.sh`;
@ -1633,6 +1802,54 @@ _EOF
ssh ksh@lo "$myscript" ssh ksh@lo "$myscript"
} }
par_mksh_environment_too_big() {
myscript=$(cat <<'_EOF'
echo 'bug #50815: env_parallel should warn if the environment is too big'
. `which env_parallel.mksh`;
bigvar="$(perl -e 'print "x"x119000')"
env_parallel echo ::: OK_bigvar
env_parallel -S lo echo ::: OK_bigvar_remote
bigvar="$(perl -e 'print "\""x119000')"
env_parallel echo ::: OK_bigvar_quote
env_parallel -S lo echo ::: OK_bigvar_quote_remote
bigvar=u
eval 'bigfunc() { a="'"$(perl -e 'print "x"x119000')"'"; };'
env_parallel echo ::: OK_bigfunc
env_parallel -S lo echo ::: OK_bigfunc_remote
eval 'bigfunc() { a="'"$(perl -e 'print "\""x119000')"'"; };'
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"x130000')"
env_parallel echo ::: fail_bigvar
env_parallel -S lo echo ::: fail_bigvar_remote
bigvar="$(perl -e 'print "\""x130000')"
env_parallel echo ::: fail_bigvar_quote
env_parallel -S lo echo ::: fail_bigvar_quote_remote
bigvar=u
eval 'bigfunc() { a="'"$(perl -e 'print "x"x129000')"'"; };'
env_parallel echo ::: fail_bigfunc
env_parallel -S lo echo ::: fail_bigfunc_remote
eval 'bigfunc() { a="'"$(perl -e 'print "\""x130000')"'"; };'
env_parallel echo ::: fail_bigfunc_quote
env_parallel -S lo echo ::: fail_bigfunc_quote_remote
bigfunc() { true; }
_EOF
)
ssh mksh@lo "$myscript"
}
par_sh_environment_too_big() { par_sh_environment_too_big() {
myscript=$(cat <<'_EOF' myscript=$(cat <<'_EOF'
echo 'bug #50815: env_parallel should warn if the environment is too big' echo 'bug #50815: env_parallel should warn if the environment is too big'
@ -1969,6 +2186,60 @@ _EOF
ssh ksh@lo "$myscript" ssh ksh@lo "$myscript"
} }
par_mksh_parset() {
myscript=$(cat <<'_EOF'
echo 'parset'
. `which env_parallel.mksh`
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 mksh@lo "$myscript"
}
par_sh_parset() { par_sh_parset() {
myscript=$(cat <<'_EOF' myscript=$(cat <<'_EOF'
echo 'parset' echo 'parset'
@ -2132,7 +2403,7 @@ par_ash_env_parallel_session() {
# Arrays not supported # Arrays not supported
# arraybefore=(array before) # arraybefore=(array before)
env_parallel --session env_parallel --session
# stuff defined # stuff defined
env_parallel aliasbefore ::: must_fail env_parallel aliasbefore ::: must_fail
env_parallel -S lo aliasbefore ::: must_fail env_parallel -S lo aliasbefore ::: must_fail
# Functions not supported # Functions not supported
@ -2175,7 +2446,7 @@ par_bash_env_parallel_session() {
funcbefore() { echo 'before' "$@"; } funcbefore() { echo 'before' "$@"; }
arraybefore=(array before) arraybefore=(array before)
env_parallel --session env_parallel --session
# stuff defined # stuff defined
env_parallel aliasbefore ::: must_fail env_parallel aliasbefore ::: must_fail
env_parallel -S lo aliasbefore ::: must_fail env_parallel -S lo aliasbefore ::: must_fail
env_parallel funcbefore ::: must_fail env_parallel funcbefore ::: must_fail
@ -2218,7 +2489,7 @@ par_dash_env_parallel_session() {
# Arrays not supported # Arrays not supported
# arraybefore=(array before) # arraybefore=(array before)
env_parallel --session env_parallel --session
# stuff defined # stuff defined
env_parallel aliasbefore ::: must_fail env_parallel aliasbefore ::: must_fail
env_parallel -S lo aliasbefore ::: must_fail env_parallel -S lo aliasbefore ::: must_fail
# Functions not supported # Functions not supported
@ -2265,7 +2536,7 @@ par_ksh_env_parallel_session() {
funcbefore() { echo 'before' "$@"; } funcbefore() { echo 'before' "$@"; }
arraybefore=(array before) arraybefore=(array before)
env_parallel --session env_parallel --session
# stuff defined # stuff defined
env_parallel aliasbefore ::: must_fail env_parallel aliasbefore ::: must_fail
env_parallel -S lo aliasbefore ::: must_fail env_parallel -S lo aliasbefore ::: must_fail
env_parallel funcbefore ::: must_fail env_parallel funcbefore ::: must_fail
@ -2292,6 +2563,43 @@ _EOF
ssh ksh@lo "$myscript" ssh ksh@lo "$myscript"
} }
par_mksh_env_parallel_session() {
myscript=$(cat <<'_EOF'
. `which env_parallel.mksh`
echo '### Test env_parallel --session'
alias aliasbefore='echo before'
varbefore='before'
funcbefore() { echo 'before' "$@"; }
arraybefore=(array before)
env_parallel --session
# stuff defined
env_parallel aliasbefore ::: must_fail
env_parallel -S lo aliasbefore ::: must_fail
env_parallel funcbefore ::: must_fail
env_parallel -S lo funcbefore ::: must_fail
env_parallel echo '$varbefore' ::: no_before
env_parallel -S lo echo '$varbefore' ::: no_before
env_parallel echo '${arraybefore[*]}' ::: no_before
env_parallel -S lo echo '${arraybefore[*]}' ::: no_before
alias aliasafter='echo after'
varafter='after'
funcafter() { echo 'after' "$@"; }
arrayafter=(array after)
env_parallel aliasafter ::: aliasafter_OK
env_parallel -S lo aliasafter ::: aliasafter_OK
env_parallel funcafter ::: funcafter_OK
env_parallel -S lo funcafter ::: funcafter_OK
env_parallel echo '$varafter' ::: varafter_OK
env_parallel -S lo echo '$varafter' ::: varafter_OK
env_parallel echo '${arrayafter[*]}' ::: arrayafter_OK
env_parallel -S lo echo '${arrayafter[*]}' ::: arrayafter_OK
unset PARALLEL_IGNORED_NAMES
_EOF
)
ssh mksh@lo "$myscript"
}
par_sh_env_parallel_session() { par_sh_env_parallel_session() {
myscript=$(cat <<'_EOF' myscript=$(cat <<'_EOF'
. `which env_parallel.sh` . `which env_parallel.sh`
@ -2304,7 +2612,7 @@ par_sh_env_parallel_session() {
# Arrays not supported # Arrays not supported
# arraybefore=(array before) # arraybefore=(array before)
env_parallel --session env_parallel --session
# stuff defined # stuff defined
env_parallel aliasbefore ::: must_fail env_parallel aliasbefore ::: must_fail
env_parallel -S lo aliasbefore ::: must_fail env_parallel -S lo aliasbefore ::: must_fail
# Functions not supported # Functions not supported
@ -2351,7 +2659,7 @@ par_zsh_env_parallel_session() {
funcbefore() { echo 'before' "$@"; } funcbefore() { echo 'before' "$@"; }
arraybefore=(array before) arraybefore=(array before)
env_parallel --session env_parallel --session
# stuff defined # stuff defined
env_parallel aliasbefore ::: must_fail env_parallel aliasbefore ::: must_fail
env_parallel -S lo aliasbefore ::: must_fail env_parallel -S lo aliasbefore ::: must_fail
env_parallel funcbefore ::: must_fail env_parallel funcbefore ::: must_fail

View file

@ -402,7 +402,7 @@ par_test_build_and_install Making install in src
par_test_build_and_install make[0]: Entering directory '/tmp/parallel-00000000/src' par_test_build_and_install make[0]: Entering directory '/tmp/parallel-00000000/src'
par_test_build_and_install make[0]: Entering directory '/tmp/parallel-00000000/src' par_test_build_and_install make[0]: Entering directory '/tmp/parallel-00000000/src'
par_test_build_and_install /bin/mkdir -p '/tmp/parallel-install/bin' par_test_build_and_install /bin/mkdir -p '/tmp/parallel-install/bin'
par_test_build_and_install /usr/bin/install -c parallel sql niceload parcat parset env_parallel env_parallel.ash env_parallel.bash env_parallel.csh env_parallel.dash env_parallel.fish env_parallel.ksh env_parallel.pdksh env_parallel.sh env_parallel.tcsh env_parallel.zsh '/tmp/parallel-install/bin' par_test_build_and_install /usr/bin/install -c parallel sql niceload parcat parset env_parallel env_parallel.ash env_parallel.bash env_parallel.csh env_parallel.dash env_parallel.fish env_parallel.ksh env_parallel.mksh env_parallel.pdksh env_parallel.sh env_parallel.tcsh env_parallel.zsh '/tmp/parallel-install/bin'
par_test_build_and_install make install-exec-hook par_test_build_and_install make install-exec-hook
par_test_build_and_install make[0]: Entering directory '/tmp/parallel-00000000/src' par_test_build_and_install make[0]: Entering directory '/tmp/parallel-00000000/src'
par_test_build_and_install rm /tmp/parallel-install/bin/sem || true par_test_build_and_install rm /tmp/parallel-install/bin/sem || true
@ -662,7 +662,7 @@ par_test_build_and_install /bin/bash: pod2pdf: command not found
par_test_build_and_install Warning: pod2pdf not found. Using old parset.pdf par_test_build_and_install Warning: pod2pdf not found. Using old parset.pdf
par_test_build_and_install make[0]: Entering directory '/tmp/parallel-00000000/src' par_test_build_and_install make[0]: Entering directory '/tmp/parallel-00000000/src'
par_test_build_and_install /bin/mkdir -p '/tmp/parallel-install/bin' par_test_build_and_install /bin/mkdir -p '/tmp/parallel-install/bin'
par_test_build_and_install /usr/bin/install -c parallel sql niceload parcat parset env_parallel env_parallel.ash env_parallel.bash env_parallel.csh env_parallel.dash env_parallel.fish env_parallel.ksh env_parallel.pdksh env_parallel.sh env_parallel.tcsh env_parallel.zsh '/tmp/parallel-install/bin' par_test_build_and_install /usr/bin/install -c parallel sql niceload parcat parset env_parallel env_parallel.ash env_parallel.bash env_parallel.csh env_parallel.dash env_parallel.fish env_parallel.ksh env_parallel.mksh env_parallel.pdksh env_parallel.sh env_parallel.tcsh env_parallel.zsh '/tmp/parallel-install/bin'
par_test_build_and_install make install-exec-hook par_test_build_and_install make install-exec-hook
par_test_build_and_install make[0]: Entering directory '/tmp/parallel-00000000/src' par_test_build_and_install make[0]: Entering directory '/tmp/parallel-00000000/src'
par_test_build_and_install rm /tmp/parallel-install/bin/sem || true par_test_build_and_install rm /tmp/parallel-install/bin/sem || true

View file

@ -543,6 +543,284 @@ 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 bug #52534: Tail of multiline alias is ignored
par_sh_env_parallel data from stdin par_sh_env_parallel data from stdin
par_sh_env_parallel data from stdin par_sh_env_parallel data from stdin
par_mksh_underscore ### mksh
par_mksh_underscore ### Testing of --env _
par_mksh_underscore variables in aliases in and arrays in functions work
par_mksh_underscore variables in aliases in and arrays in functions work
par_mksh_underscore variables in aliases in and arrays in functions work
par_mksh_underscore variables in aliases in and arrays in functions work
par_mksh_underscore variables in aliases in and arrays in functions work
par_mksh_underscore variables in aliases in and arrays in functions work
par_mksh_underscore /bin/mksh: not_copied_alias: not found
par_mksh_underscore /bin/mksh: not_copied_func: not found
par_mksh_underscore error=OK
par_mksh_underscore error=OK
par_mksh_underscore aliases in and arrays in functions work
par_mksh_underscore aliases in and arrays in functions work
par_mksh_underscore aliases in functions work
par_mksh_underscore aliases in functions work
par_mksh_underscore aliases in functions work
par_mksh_underscore OK if no myecho ^^^^^^^^^^^^^^^^^
par_mksh_underscore aliases in functions work
par_mksh_underscore OK if no myecho ^^^^^^^^^^^^^^^^^
par_mksh_underscore /bin/mksh: myfunc: not found
par_mksh_underscore OK if no myfunc ^^^^^^^^^^^^^^^^^
par_mksh_underscore /bin/mksh: myfunc: not found
par_mksh_underscore OK if no myfunc ^^^^^^^^^^^^^^^^^
par_mksh_parset parset
par_mksh_parset ### parset into array
par_mksh_parset foo bar baz
par_mksh_parset ### parset into vars with comma
par_mksh_parset foo bar baz
par_mksh_parset ### parset into vars with space
par_mksh_parset foo bar baz
par_mksh_parset ### parset with newlines
par_mksh_parset 1
par_mksh_parset 1
par_mksh_parset 2
par_mksh_parset 1
par_mksh_parset 2
par_mksh_parset 3
par_mksh_parset ### parset into indexed array vars
par_mksh_parset foo bar baz
par_mksh_parset foo bar baz
par_mksh_parset ### env_parset
par_mksh_parset myecho myvar myarr 1 myfun foo myecho myvar myarr 1 myfun bar myecho myvar myarr 1 myfun baz
par_mksh_parset myecho myvar myarr 1 myfun foo myecho myvar myarr 1 myfun bar myecho myvar myarr 1 myfun baz
par_mksh_parset
par_mksh_parset newline1
par_mksh_parset newline2
par_mksh_parset 1
par_mksh_parset newline1
par_mksh_parset newline2
par_mksh_parset 1
par_mksh_parset 2
par_mksh_parset newline1
par_mksh_parset newline2
par_mksh_parset 1
par_mksh_parset 2
par_mksh_parset 3
par_mksh_parset myecho myvar myarr 1 myfun foo myecho myvar myarr 1 myfun bar myecho myvar myarr 1 myfun baz
par_mksh_parset myecho myvar myarr 1 myfun foo myecho myvar myarr 1 myfun bar myecho myvar myarr 1 myfun baz
par_mksh_man ### mksh
par_mksh_man ### From man env_parallel
par_mksh_man aliases with = & " ! ' work
par_mksh_man aliases with = & " ! ' work
par_mksh_man aliases with = & " ! ' work
par_mksh_man aliases with = & " ! ' work
par_mksh_man aliases with = & " ! ' work
par_mksh_man multiline
par_mksh_man aliases with = & " ! ' work
par_mksh_man env_parallel: Warning: Alias "multiline" contains newline.
par_mksh_man env_parallel: Warning: Make sure the command has at least one newline after "multiline".
par_mksh_man env_parallel: Warning: See BUGS in "man env_parallel".
par_mksh_man multiline
par_mksh_man aliases with = & " ! ' work
par_mksh_man env_parallel: Warning: Alias "multiline" contains newline.
par_mksh_man env_parallel: Warning: Make sure the command has at least one newline after "multiline".
par_mksh_man env_parallel: Warning: See BUGS in "man env_parallel".
par_mksh_man multiline
par_mksh_man aliases with = & " ! ' work
par_mksh_man env_parallel: Warning: Alias "multiline" contains newline.
par_mksh_man env_parallel: Warning: Make sure the command has at least one newline after "multiline".
par_mksh_man env_parallel: Warning: See BUGS in "man env_parallel".
par_mksh_man multiline
par_mksh_man aliases with = & " ! ' work
par_mksh_man env_parallel: Warning: Alias "multiline" contains newline.
par_mksh_man env_parallel: Warning: Make sure the command has at least one newline after "multiline".
par_mksh_man env_parallel: Warning: See BUGS in "man env_parallel".
par_mksh_man multiline
par_mksh_man aliases with = & " ! ' work
par_mksh_man functions with = & " ! ' work
par_mksh_man functions with = & " ! ' work
par_mksh_man functions with = & " ! ' work
par_mksh_man functions with = & " ! ' work
par_mksh_man functions with = & " ! ' work
par_mksh_man variables with = & " ! ' work
par_mksh_man variables with = & " ! ' work
par_mksh_man variables with = & " ! ' work
par_mksh_man variables with = & " ! ' work
par_mksh_man variables with = & " ! ' work
par_mksh_man multiline
par_mksh_man variables with = & " ! ' work
par_mksh_man multiline
par_mksh_man variables with = & " ! ' work
par_mksh_man multiline
par_mksh_man variables with = & " ! ' work
par_mksh_man multiline
par_mksh_man variables with = & " ! ' work
par_mksh_man multiline
par_mksh_man variables with = & " ! ' work
par_mksh_man arrays with = & " ! ' work, too
par_mksh_man arrays
par_mksh_man with = & " ! '
par_mksh_man work,
par_mksh_man too
par_mksh_man arrays
par_mksh_man with = & " ! '
par_mksh_man work,
par_mksh_man too
par_mksh_man arrays
par_mksh_man with = & " ! '
par_mksh_man work,
par_mksh_man too
par_mksh_man arrays
par_mksh_man with = & " ! '
par_mksh_man work,
par_mksh_man too
par_mksh_man exit value 2 should be 2
par_mksh_man Unknown option: no-such-option
par_mksh_man exit value 255 should be 255
par_mksh_funky
par_mksh_funky \\\\\\\\
par_mksh_funky  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<7F>ƒ„…†‡ˆ‰ŠŒ<E280B9>Ž<EFBFBD><C5BD>“”•˜™šœ<E280BA>žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ-funky
par_mksh_funky  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<7F>ƒ„…†‡ˆ‰ŠŒ<E280B9>Ž<EFBFBD><C5BD>“”•˜™šœ<E280BA>žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ-funky
par_mksh_funky space 6
par_mksh_funky space 6
par_mksh_funky 3 arg alias_works
par_mksh_funky 3 arg alias_works_over_ssh
par_mksh_funky Funky-
par_mksh_funky Funky-
par_mksh_funky \ \ \ \\\\\\\\\\\\\\ \!\"\#\$%\&\'\(\)\*+,-./0123456789:\;\<\=\>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\^_\`abcdefghijklmnopqrstuvwxyz\{\|\}\~<7F>\\ƒ\„\…\†\‡\ˆ\‰\Š\\Œ\<5C>\Ž\<5C>\<5C>\\\“\”\•\\—\˜\™\š\\œ\<5C>\ž\Ÿ\ \¡\¢\£\¤\¥\¦\§\¨\©\ª\«\¬\­\®\¯\°\±\²\³\´\µ\¶\·\¸\¹\º\»\¼\½\¾\¿\À\Á\Â\Ã\Ä\Å\Æ\Ç\È\É\Ê\Ë\Ì\Í\Î\Ï\Ð\Ñ\Ò\Ó\Ô\Õ\Ö\×\Ø\Ù\Ú\Û\Ü\Ý\Þ\ß\à\á\â\ã\ä\å\æ\ç\è\é\ê\ë\ì\í\î\ï\ð\ñ\ò\ó\ô\õ\ö\÷\ø\ù\ú\û\ü\ý\þ\ÿ
par_mksh_funky function_works
par_mksh_funky function_works_over_ssh
par_mksh_funky myvar works
par_mksh_funky myvar works
par_mksh_environment_too_big bug #50815: env_parallel should warn if the environment is too big
par_mksh_environment_too_big OK_bigvar
par_mksh_environment_too_big OK_bigvar_remote
par_mksh_environment_too_big OK_bigvar_quote
par_mksh_environment_too_big OK_bigvar_quote_remote
par_mksh_environment_too_big OK_bigfunc
par_mksh_environment_too_big OK_bigfunc_remote
par_mksh_environment_too_big OK_bigfunc_quote
par_mksh_environment_too_big OK_bigfunc_quote_remote
par_mksh_environment_too_big Rest should fail
par_mksh_environment_too_big mksh: /usr/bin/perl: Argument list too long
par_mksh_environment_too_big env_parallel: Error: Your environment is too big.
par_mksh_environment_too_big env_parallel: Error: You can try 3 different approaches:
par_mksh_environment_too_big env_parallel: Error: 1. Run 'env_parallel --session' before you set
par_mksh_environment_too_big env_parallel: Error: variables or define functions.
par_mksh_environment_too_big env_parallel: Error: 2. Use --env and only mention the names to copy.
par_mksh_environment_too_big env_parallel: Error: 3. Try running this in a clean environment once:
par_mksh_environment_too_big env_parallel: Error: env_parallel --record-env
par_mksh_environment_too_big env_parallel: Error: And then use '--env _'
par_mksh_environment_too_big env_parallel: Error: For details see: man env_parallel
par_mksh_environment_too_big mksh: /usr/bin/perl: Argument list too long
par_mksh_environment_too_big env_parallel: Error: Your environment is too big.
par_mksh_environment_too_big env_parallel: Error: You can try 3 different approaches:
par_mksh_environment_too_big env_parallel: Error: 1. Run 'env_parallel --session' before you set
par_mksh_environment_too_big env_parallel: Error: variables or define functions.
par_mksh_environment_too_big env_parallel: Error: 2. Use --env and only mention the names to copy.
par_mksh_environment_too_big env_parallel: Error: 3. Try running this in a clean environment once:
par_mksh_environment_too_big env_parallel: Error: env_parallel --record-env
par_mksh_environment_too_big env_parallel: Error: And then use '--env _'
par_mksh_environment_too_big env_parallel: Error: For details see: man env_parallel
par_mksh_environment_too_big mksh: /usr/bin/perl: Argument list too long
par_mksh_environment_too_big env_parallel: Error: Your environment is too big.
par_mksh_environment_too_big env_parallel: Error: You can try 3 different approaches:
par_mksh_environment_too_big env_parallel: Error: 1. Run 'env_parallel --session' before you set
par_mksh_environment_too_big env_parallel: Error: variables or define functions.
par_mksh_environment_too_big env_parallel: Error: 2. Use --env and only mention the names to copy.
par_mksh_environment_too_big env_parallel: Error: 3. Try running this in a clean environment once:
par_mksh_environment_too_big env_parallel: Error: env_parallel --record-env
par_mksh_environment_too_big env_parallel: Error: And then use '--env _'
par_mksh_environment_too_big env_parallel: Error: For details see: man env_parallel
par_mksh_environment_too_big mksh: /usr/bin/perl: Argument list too long
par_mksh_environment_too_big env_parallel: Error: Your environment is too big.
par_mksh_environment_too_big env_parallel: Error: You can try 3 different approaches:
par_mksh_environment_too_big env_parallel: Error: 1. Run 'env_parallel --session' before you set
par_mksh_environment_too_big env_parallel: Error: variables or define functions.
par_mksh_environment_too_big env_parallel: Error: 2. Use --env and only mention the names to copy.
par_mksh_environment_too_big env_parallel: Error: 3. Try running this in a clean environment once:
par_mksh_environment_too_big env_parallel: Error: env_parallel --record-env
par_mksh_environment_too_big env_parallel: Error: And then use '--env _'
par_mksh_environment_too_big env_parallel: Error: For details see: man env_parallel
par_mksh_environment_too_big mksh: /usr/bin/perl: Argument list too long
par_mksh_environment_too_big env_parallel: Error: Your environment is too big.
par_mksh_environment_too_big env_parallel: Error: You can try 3 different approaches:
par_mksh_environment_too_big env_parallel: Error: 1. Run 'env_parallel --session' before you set
par_mksh_environment_too_big env_parallel: Error: variables or define functions.
par_mksh_environment_too_big env_parallel: Error: 2. Use --env and only mention the names to copy.
par_mksh_environment_too_big env_parallel: Error: 3. Try running this in a clean environment once:
par_mksh_environment_too_big env_parallel: Error: env_parallel --record-env
par_mksh_environment_too_big env_parallel: Error: And then use '--env _'
par_mksh_environment_too_big env_parallel: Error: For details see: man env_parallel
par_mksh_environment_too_big mksh: /usr/bin/perl: Argument list too long
par_mksh_environment_too_big env_parallel: Error: Your environment is too big.
par_mksh_environment_too_big env_parallel: Error: You can try 3 different approaches:
par_mksh_environment_too_big env_parallel: Error: 1. Run 'env_parallel --session' before you set
par_mksh_environment_too_big env_parallel: Error: variables or define functions.
par_mksh_environment_too_big env_parallel: Error: 2. Use --env and only mention the names to copy.
par_mksh_environment_too_big env_parallel: Error: 3. Try running this in a clean environment once:
par_mksh_environment_too_big env_parallel: Error: env_parallel --record-env
par_mksh_environment_too_big env_parallel: Error: And then use '--env _'
par_mksh_environment_too_big env_parallel: Error: For details see: man env_parallel
par_mksh_environment_too_big mksh: /usr/bin/perl: Argument list too long
par_mksh_environment_too_big env_parallel: Error: Your environment is too big.
par_mksh_environment_too_big env_parallel: Error: You can try 3 different approaches:
par_mksh_environment_too_big env_parallel: Error: 1. Run 'env_parallel --session' before you set
par_mksh_environment_too_big env_parallel: Error: variables or define functions.
par_mksh_environment_too_big env_parallel: Error: 2. Use --env and only mention the names to copy.
par_mksh_environment_too_big env_parallel: Error: 3. Try running this in a clean environment once:
par_mksh_environment_too_big env_parallel: Error: env_parallel --record-env
par_mksh_environment_too_big env_parallel: Error: And then use '--env _'
par_mksh_environment_too_big env_parallel: Error: For details see: man env_parallel
par_mksh_environment_too_big mksh: /usr/bin/perl: Argument list too long
par_mksh_environment_too_big env_parallel: Error: Your environment is too big.
par_mksh_environment_too_big env_parallel: Error: You can try 3 different approaches:
par_mksh_environment_too_big env_parallel: Error: 1. Run 'env_parallel --session' before you set
par_mksh_environment_too_big env_parallel: Error: variables or define functions.
par_mksh_environment_too_big env_parallel: Error: 2. Use --env and only mention the names to copy.
par_mksh_environment_too_big env_parallel: Error: 3. Try running this in a clean environment once:
par_mksh_environment_too_big env_parallel: Error: env_parallel --record-env
par_mksh_environment_too_big env_parallel: Error: And then use '--env _'
par_mksh_environment_too_big env_parallel: Error: For details see: man env_parallel
par_mksh_env_parallel_session ### Test env_parallel --session
par_mksh_env_parallel_session /bin/mksh: aliasbefore: not found
par_mksh_env_parallel_session /bin/mksh: aliasbefore: not found
par_mksh_env_parallel_session /bin/mksh: funcbefore: not found
par_mksh_env_parallel_session /bin/mksh: funcbefore: not found
par_mksh_env_parallel_session no_before
par_mksh_env_parallel_session no_before
par_mksh_env_parallel_session no_before
par_mksh_env_parallel_session no_before
par_mksh_env_parallel_session after aliasafter_OK
par_mksh_env_parallel_session after aliasafter_OK
par_mksh_env_parallel_session after funcafter_OK
par_mksh_env_parallel_session after funcafter_OK
par_mksh_env_parallel_session after varafter_OK
par_mksh_env_parallel_session after varafter_OK
par_mksh_env_parallel_session array after arrayafter_OK
par_mksh_env_parallel_session array after arrayafter_OK
par_mksh_env_parallel OK
par_mksh_env_parallel OK
par_mksh_env_parallel alias line 1
par_mksh_env_parallel alias line 1
par_mksh_env_parallel alias line 2
par_mksh_env_parallel alias line 2
par_mksh_env_parallel alias line 3
par_mksh_env_parallel alias line 3
par_mksh_env_parallel alias2 line 1
par_mksh_env_parallel alias2 line 1
par_mksh_env_parallel alias2 line 2
par_mksh_env_parallel alias2 line 2
par_mksh_env_parallel bug #50435: Remote fifo broke in 20150522
par_mksh_env_parallel bug #52534: Tail of multiline alias is ignored
par_mksh_env_parallel data from stdin
par_mksh_env_parallel data from stdin
par_mksh_env_parallel env_parallel: Warning: Alias "myalias" contains newline.
par_mksh_env_parallel env_parallel: Warning: Alias "myalias" contains newline.
par_mksh_env_parallel env_parallel: Warning: Alias "myalias2" contains newline.
par_mksh_env_parallel env_parallel: Warning: Alias "myalias2" contains newline.
par_mksh_env_parallel env_parallel: Warning: Make sure the command has at least one newline after "myalias".
par_mksh_env_parallel env_parallel: Warning: Make sure the command has at least one newline after "myalias".
par_mksh_env_parallel env_parallel: Warning: Make sure the command has at least one newline after "myalias2".
par_mksh_env_parallel env_parallel: Warning: Make sure the command has at least one newline after "myalias2".
par_mksh_env_parallel env_parallel: Warning: See BUGS in "man env_parallel".
par_mksh_env_parallel env_parallel: Warning: See BUGS in "man env_parallel".
par_mksh_env_parallel env_parallel: Warning: See BUGS in "man env_parallel".
par_mksh_env_parallel env_parallel: Warning: See BUGS in "man env_parallel".
par_ksh_underscore ### ksh par_ksh_underscore ### ksh
par_ksh_underscore ### Testing of --env _ par_ksh_underscore ### Testing of --env _
par_ksh_underscore variables in aliases in and arrays in functions work par_ksh_underscore variables in aliases in and arrays in functions work