2016-07-05 11:28:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-12-26 22:29:28 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2022 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
2021-03-22 20:16:35 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2018-12-29 20:04:58 +00:00
|
|
|
echo '### test --env _, env_parallel for different shells'
|
2016-07-05 11:28:22 +00:00
|
|
|
|
2016-11-06 22:01:42 +00:00
|
|
|
#
|
|
|
|
## par_*_man = tests from the man page
|
|
|
|
#
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_ash_man() {
|
|
|
|
echo '### ash'
|
|
|
|
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### From man env_parallel"
|
|
|
|
|
|
|
|
. `which env_parallel.ash`;
|
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
alias myecho='echo aliases with \= \& \" \!'" \'"
|
|
|
|
myecho work
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel myecho ::: work
|
|
|
|
env_parallel -S server myecho ::: work
|
|
|
|
env_parallel --env myecho myecho ::: work
|
|
|
|
env_parallel --env myecho -S server myecho ::: work
|
2018-01-25 02:48:16 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
alias multiline='echo multiline
|
2018-01-25 02:48:16 +00:00
|
|
|
echo aliases with \= \& \" \!'" \'"
|
|
|
|
multiline work
|
2017-12-03 00:40:01 +00:00
|
|
|
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"
|
2018-01-25 02:48:16 +00:00
|
|
|
|
|
|
|
# Functions are not supported in ash
|
|
|
|
|
|
|
|
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
|
2017-12-03 00:40:01 +00:00
|
|
|
|
|
|
|
multivar='multiline
|
2018-01-25 02:48:16 +00:00
|
|
|
variables with = & " !'" '"
|
|
|
|
echo "$multivar" work
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
# Arrays are not supported in ash
|
|
|
|
|
2018-07-18 15:29:57 +00:00
|
|
|
# Exporting of functions is not supported
|
|
|
|
# env_parallel --argsep --- env_parallel -k echo ::: multi level --- env_parallel
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel ::: true false true false
|
|
|
|
echo exit value $? should be 2
|
|
|
|
|
2018-03-06 00:32:41 +00:00
|
|
|
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`
|
2017-12-03 00:40:01 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh ash@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
par_bash_man() {
|
|
|
|
echo '### bash'
|
|
|
|
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### From man env_parallel"
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2016-08-01 23:34:03 +00:00
|
|
|
. `which env_parallel.bash`;
|
2018-01-25 02:48:16 +00:00
|
|
|
shopt -s expand_aliases&>/dev/null;
|
2016-08-01 23:34:03 +00:00
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
alias myecho='echo aliases with \= \& \" \!'" \'"
|
|
|
|
myecho work
|
2017-12-01 19:53:56 +00:00
|
|
|
env_parallel myecho ::: work
|
|
|
|
env_parallel -S server myecho ::: work
|
|
|
|
env_parallel --env myecho myecho ::: work
|
2016-07-10 20:57:33 +00:00
|
|
|
env_parallel --env myecho -S server myecho ::: work
|
2018-01-25 02:48:16 +00:00
|
|
|
|
|
|
|
# multiline aliases with when followed by newline
|
2017-12-01 19:53:56 +00:00
|
|
|
alias multiline='echo multiline
|
2018-01-25 02:48:16 +00:00
|
|
|
echo aliases with \= \& \" \!'" \'"
|
|
|
|
multiline work
|
2017-12-01 19:53:56 +00:00
|
|
|
env_parallel 'multiline {};
|
|
|
|
echo but only when followed by a newline' ::: work
|
|
|
|
env_parallel -S server 'multiline {};
|
|
|
|
echo but only when followed by a newline' ::: work
|
|
|
|
env_parallel --env multiline 'multiline {};
|
|
|
|
echo but only when followed by a newline' ::: work
|
|
|
|
env_parallel --env multiline -S server 'multiline {};
|
|
|
|
echo but only when followed by a newline' ::: work
|
|
|
|
alias multiline="dummy"
|
2018-01-25 02:48:16 +00:00
|
|
|
|
|
|
|
myfunc() { echo functions 'with = & " !'" '" $*; }
|
|
|
|
myfunc work
|
2017-12-01 19:53:56 +00:00
|
|
|
env_parallel myfunc ::: work
|
|
|
|
env_parallel -S server myfunc ::: work
|
|
|
|
env_parallel --env myfunc myfunc ::: work
|
2016-07-10 20:57:33 +00:00
|
|
|
env_parallel --env myfunc -S server myfunc ::: work
|
2018-01-25 02:48:16 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
multivar='multiline
|
2018-01-25 02:48:16 +00:00
|
|
|
variables with = & " !'" '"
|
|
|
|
echo "$multivar" work
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
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
|
2016-10-17 22:02:48 +00:00
|
|
|
|
2018-07-18 15:29:57 +00:00
|
|
|
env_parallel --argsep --- env_parallel -k echo ::: multi level --- env_parallel
|
|
|
|
|
2016-10-17 22:02:48 +00:00
|
|
|
env_parallel ::: true false true false
|
|
|
|
echo exit value $? should be 2
|
2016-10-22 11:46:01 +00:00
|
|
|
|
2018-03-06 00:32:41 +00:00
|
|
|
env_parallel --no-such-option 2>&1 >/dev/null
|
2018-01-03 08:03:16 +00:00
|
|
|
# Sleep 1 to delay output to stderr to avoid race
|
|
|
|
echo exit value $? should be 255 `sleep 1`
|
2016-07-05 11:28:22 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh bash@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_csh_man() {
|
|
|
|
echo '### csh'
|
2016-07-05 11:28:22 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### From man env_parallel"
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
# source `which env_parallel.csh`;
|
|
|
|
|
2018-01-22 16:23:23 +00:00
|
|
|
alias myecho 'echo aliases with \= \& \"'
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
# TODO This does not work
|
|
|
|
# set myvar='variables with = & "'" '"
|
2018-01-22 16:23:23 +00:00
|
|
|
set myvar='variables with \= \& \"'
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
# Space is not supported in arrays
|
|
|
|
|
|
|
|
set myarray=(arrays with\=\&\""'" work, too)
|
2018-01-22 16:23:23 +00:00
|
|
|
env_parallel -k echo \$'{myarray[{}]}' ::: 1 2 3 4
|
|
|
|
env_parallel -k -S server echo \$'{myarray[{}]}' ::: 1 2 3 4
|
|
|
|
env_parallel -k --env myarray echo \$'{myarray[{}]}' ::: 1 2 3 4
|
|
|
|
env_parallel -k --env myarray -S server echo \$'{myarray[{}]}' ::: 1 2 3 4
|
2017-12-03 00:40:01 +00:00
|
|
|
|
2018-07-18 15:29:57 +00:00
|
|
|
env_parallel --argsep --- env_parallel -k echo ::: multi level --- env_parallel
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel ::: true false true false
|
|
|
|
echo exit value $status should be 2
|
|
|
|
|
|
|
|
env_parallel --no-such-option >/dev/null
|
2018-03-06 00:32:41 +00:00
|
|
|
echo exit value $status should be 255 `sleep 1`
|
2017-12-03 00:40:01 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
# Sometimes the order f*cks up
|
2018-10-22 22:46:38 +00:00
|
|
|
stdout ssh csh@lo "$myscript" | LC_ALL=C sort
|
2017-12-03 00:40:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
par_dash_man() {
|
|
|
|
echo '### dash'
|
|
|
|
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### From man env_parallel"
|
|
|
|
|
|
|
|
. `which env_parallel.dash`;
|
2016-08-01 23:34:03 +00:00
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
alias myecho='echo aliases with \= \& \" \!'" \'"
|
|
|
|
myecho work
|
2017-12-01 19:53:56 +00:00
|
|
|
env_parallel myecho ::: work
|
|
|
|
env_parallel -S server myecho ::: work
|
|
|
|
env_parallel --env myecho myecho ::: work
|
2016-07-10 20:57:33 +00:00
|
|
|
env_parallel --env myecho -S server myecho ::: work
|
2018-01-25 02:48:16 +00:00
|
|
|
|
2017-12-01 19:53:56 +00:00
|
|
|
alias multiline='echo multiline
|
2018-01-25 02:48:16 +00:00
|
|
|
echo aliases with \= \& \" \!'" \'"
|
|
|
|
multiline work
|
2017-12-01 19:53:56 +00:00
|
|
|
env_parallel multiline ::: work
|
|
|
|
env_parallel -S server multiline ::: work
|
|
|
|
env_parallel --env multiline multiline ::: work
|
|
|
|
env_parallel --env multiline -S server multiline ::: work
|
2017-12-03 00:40:01 +00:00
|
|
|
alias multiline="dummy"
|
2018-01-25 02:48:16 +00:00
|
|
|
|
|
|
|
# Functions are not supported in dash
|
|
|
|
|
|
|
|
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
|
2017-12-03 00:40:01 +00:00
|
|
|
|
|
|
|
multivar='multiline
|
2018-01-25 02:48:16 +00:00
|
|
|
variables with = & " !'" '"
|
|
|
|
echo "$multivar" work
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
2016-10-17 22:02:48 +00:00
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
# Arrays are not supported in dash
|
|
|
|
|
2018-07-18 15:29:57 +00:00
|
|
|
# Exporting of functions is not supported
|
|
|
|
# env_parallel --argsep --- env_parallel -k echo ::: multi level --- env_parallel
|
|
|
|
|
2016-10-17 22:02:48 +00:00
|
|
|
env_parallel ::: true false true false
|
|
|
|
echo exit value $? should be 2
|
2016-10-22 11:46:01 +00:00
|
|
|
|
2018-03-06 00:32:41 +00:00
|
|
|
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`
|
2016-07-05 11:28:22 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
ssh dash@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
|
|
|
par_fish_man() {
|
|
|
|
echo '### fish'
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### From man env_parallel"
|
|
|
|
|
2018-10-22 22:46:38 +00:00
|
|
|
env_parallel --session
|
2018-01-25 02:48:16 +00:00
|
|
|
alias myecho='echo aliases with \= \& \" \!'" \'"
|
|
|
|
myecho work
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel myecho ::: work
|
|
|
|
env_parallel -S server myecho ::: work
|
|
|
|
env_parallel --env myecho myecho ::: work
|
|
|
|
env_parallel --env myecho -S server myecho ::: work
|
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
# multiline aliases does not work in fish
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
function myfunc
|
2018-01-25 02:48:16 +00:00
|
|
|
echo functions 'with = & " !'" '" $argv;
|
2017-12-03 00:40:01 +00:00
|
|
|
end
|
2018-01-25 02:48:16 +00:00
|
|
|
myfunc work
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel myfunc ::: work
|
|
|
|
env_parallel -S server myfunc ::: work
|
|
|
|
env_parallel --env myfunc myfunc ::: work
|
|
|
|
env_parallel --env myfunc -S server myfunc ::: work
|
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
set myvar 'variables with = & " !'" '"
|
|
|
|
echo "$myvar" work
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
set 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
|
|
|
|
|
|
|
|
set myarray arrays 'with = & " !'" '" work, too
|
|
|
|
echo $myarray[1] $myarray[2] $myarray[3] $myarray[4]
|
2018-01-22 16:23:23 +00:00
|
|
|
env_parallel -k echo '$myarray[{}]' ::: 1 2 3 4
|
|
|
|
env_parallel -k -S server echo '$myarray[{}]' ::: 1 2 3 4
|
|
|
|
env_parallel -k --env myarray echo '$myarray[{}]' ::: 1 2 3 4
|
|
|
|
env_parallel -k --env myarray -S server echo '$myarray[{}]' ::: 1 2 3 4
|
2017-12-03 00:40:01 +00:00
|
|
|
|
2018-07-18 15:29:57 +00:00
|
|
|
env_parallel --argsep --- env_parallel -k echo ::: multi level --- env_parallel
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel ::: true false true false
|
|
|
|
echo exit value $status should be 2
|
|
|
|
|
2018-03-06 00:32:41 +00:00
|
|
|
env_parallel --no-such-option >/dev/null
|
|
|
|
echo exit value $status should be 255 `sleep 1`
|
2017-12-03 00:40:01 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2020-06-22 22:34:52 +00:00
|
|
|
ssh fish@lo "$myscript" | LC_ALL=C sort
|
2016-07-05 11:28:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
par_ksh_man() {
|
|
|
|
echo '### ksh'
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### From man env_parallel"
|
2016-07-10 20:57:33 +00:00
|
|
|
|
|
|
|
. `which env_parallel.ksh`;
|
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
alias myecho='echo aliases with \= \& \" \!'" \'"
|
|
|
|
myecho work
|
2017-12-01 19:53:56 +00:00
|
|
|
env_parallel myecho ::: work
|
|
|
|
env_parallel -S server myecho ::: work
|
|
|
|
env_parallel --env myecho myecho ::: work
|
|
|
|
env_parallel --env myecho -S server myecho ::: work
|
2018-01-25 02:48:16 +00:00
|
|
|
|
2017-12-01 19:53:56 +00:00
|
|
|
alias multiline='echo multiline
|
2018-01-25 02:48:16 +00:00
|
|
|
echo aliases with \= \& \" \!'" \'"
|
|
|
|
multiline work
|
2017-12-01 19:53:56 +00:00
|
|
|
env_parallel multiline ::: work
|
|
|
|
env_parallel -S server multiline ::: work
|
|
|
|
env_parallel --env multiline multiline ::: work
|
|
|
|
env_parallel --env multiline -S server multiline ::: work
|
2017-12-03 00:40:01 +00:00
|
|
|
alias multiline='dummy'
|
2018-01-25 02:48:16 +00:00
|
|
|
|
|
|
|
myfunc() { echo functions 'with = & " !'" '" $*; }
|
|
|
|
myfunc work
|
2017-12-01 19:53:56 +00:00
|
|
|
env_parallel myfunc ::: work
|
|
|
|
env_parallel -S server myfunc ::: work
|
|
|
|
env_parallel --env myfunc myfunc ::: work
|
2016-07-10 20:57:33 +00:00
|
|
|
env_parallel --env myfunc -S server myfunc ::: work
|
2018-01-25 02:48:16 +00:00
|
|
|
|
|
|
|
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
|
2016-10-17 22:02:48 +00:00
|
|
|
|
2018-07-22 06:58:32 +00:00
|
|
|
echo This may never work
|
|
|
|
echo https://unix.stackexchange.com/questions/457031/extract-full-function-definitions
|
2018-07-18 15:29:57 +00:00
|
|
|
env_parallel --argsep --- env_parallel -k echo ::: multi level --- env_parallel
|
|
|
|
|
2016-10-17 22:02:48 +00:00
|
|
|
env_parallel ::: true false true false
|
|
|
|
echo exit value $? should be 2
|
2016-10-22 11:46:01 +00:00
|
|
|
|
2018-03-06 00:32:41 +00:00
|
|
|
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`
|
2016-07-05 11:28:22 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh ksh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2018-07-13 05:33:11 +00:00
|
|
|
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
|
|
|
|
|
2018-07-18 15:29:57 +00:00
|
|
|
env_parallel --argsep --- env_parallel -k echo ::: multi level --- env_parallel
|
|
|
|
|
2018-07-13 05:33:11 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_sh_man() {
|
|
|
|
echo '### sh'
|
|
|
|
|
2016-07-14 07:35:39 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### From man env_parallel"
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.sh`;
|
2016-07-14 07:35:39 +00:00
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
alias myecho='echo aliases with \= \& \" \!'" \'"
|
|
|
|
myecho work
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel myecho ::: work
|
|
|
|
env_parallel -S server myecho ::: work
|
|
|
|
env_parallel --env myecho myecho ::: work
|
|
|
|
env_parallel --env myecho -S server myecho ::: work
|
2018-01-25 02:48:16 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
alias multiline='echo multiline
|
2018-01-25 02:48:16 +00:00
|
|
|
echo aliases with \= \& \" \!'" \'"
|
|
|
|
multiline work
|
2017-12-03 00:40:01 +00:00
|
|
|
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"
|
2018-01-25 02:48:16 +00:00
|
|
|
|
|
|
|
# Functions not supported
|
|
|
|
|
|
|
|
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
|
2016-07-14 07:35:39 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
multivar='multiline
|
2018-01-25 02:48:16 +00:00
|
|
|
variables with = & " !'" '"
|
|
|
|
echo "$multivar" work
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
2016-10-17 22:02:48 +00:00
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays are not supported
|
2018-01-25 02:48:16 +00:00
|
|
|
|
2018-07-18 15:29:57 +00:00
|
|
|
# Exporting of functions is not supported
|
|
|
|
# env_parallel --argsep --- env_parallel -k echo ::: multi level --- env_parallel
|
|
|
|
|
2016-10-17 22:02:48 +00:00
|
|
|
env_parallel ::: true false true false
|
|
|
|
echo exit value $? should be 2
|
2016-10-22 11:46:01 +00:00
|
|
|
|
2018-03-06 00:32:41 +00:00
|
|
|
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`
|
2016-07-14 07:35:39 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
ssh sh@lo "$myscript"
|
2016-07-14 07:35:39 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 20:57:33 +00:00
|
|
|
par_tcsh_man() {
|
|
|
|
echo '### tcsh'
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### From man env_parallel"
|
|
|
|
|
2016-07-22 21:57:23 +00:00
|
|
|
# source `which env_parallel.tcsh`
|
|
|
|
|
2018-01-22 16:23:23 +00:00
|
|
|
alias myecho 'echo aliases with \= \& \"'
|
2016-07-10 20:57:33 +00:00
|
|
|
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
|
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
# TODO This does not work
|
|
|
|
# set myvar='variables with = & "'" '"
|
2018-01-22 16:23:23 +00:00
|
|
|
set myvar='variables with \= \& \"'
|
2016-07-10 20:57:33 +00:00
|
|
|
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
|
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
# Space is not supported in arrays
|
|
|
|
|
|
|
|
set myarray=(arrays with\=\&\""'" work, too)
|
|
|
|
env_parallel -k echo \$'{myarray[{}]}' ::: 1 2 3 4
|
|
|
|
env_parallel -k -S server echo \$'{myarray[{}]}' ::: 1 2 3 4
|
|
|
|
env_parallel -k --env myarray echo \$'{myarray[{}]}' ::: 1 2 3 4
|
|
|
|
env_parallel -k --env myarray -S server echo \$'{myarray[{}]}' ::: 1 2 3 4
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2018-12-29 20:04:58 +00:00
|
|
|
echo 'Segmentation faults? Are you running bsd-csh version 20110502-3?'
|
2018-07-18 15:29:57 +00:00
|
|
|
env_parallel --argsep --- env_parallel -k echo ::: multi level --- env_parallel
|
|
|
|
|
2016-10-17 22:02:48 +00:00
|
|
|
env_parallel ::: true false true false
|
|
|
|
echo exit value $status should be 2
|
2016-10-22 11:46:01 +00:00
|
|
|
|
|
|
|
env_parallel --no-such-option >/dev/null
|
2018-03-06 00:32:41 +00:00
|
|
|
echo exit value $status should be 255 `sleep 1`
|
2016-07-10 20:57:33 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh -tt tcsh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_zsh_man() {
|
|
|
|
echo '### zsh'
|
2018-01-25 02:48:16 +00:00
|
|
|
# eval is needed make aliases work
|
2016-07-10 20:57:33 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### From man env_parallel"
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.zsh`;
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2018-01-25 02:48:16 +00:00
|
|
|
alias myecho='echo aliases with \= \& \" \!'" \'"
|
|
|
|
# eval is needed make aliases work
|
|
|
|
eval myecho work
|
2016-07-10 20:57:33 +00:00
|
|
|
env_parallel myecho ::: work
|
|
|
|
env_parallel -S server myecho ::: work
|
2016-07-11 01:50:52 +00:00
|
|
|
env_parallel --env myecho myecho ::: work
|
|
|
|
env_parallel --env myecho -S server myecho ::: work
|
2018-01-25 02:48:16 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
alias multiline='echo multiline
|
2018-01-25 02:48:16 +00:00
|
|
|
echo aliases with \= \& \" \!'" \'"
|
|
|
|
eval multiline work
|
2018-10-22 22:46:38 +00:00
|
|
|
# Zsh-5.4.2 requires additional quoting when multiline
|
|
|
|
# Looks like a bug
|
|
|
|
alias multiline='echo multiline
|
|
|
|
echo aliases with \\= \\& \\" \\!'" \\\'"
|
|
|
|
# eval is needed make aliases work
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel multiline ::: work
|
|
|
|
env_parallel -S server multiline ::: work
|
|
|
|
env_parallel --env multiline multiline ::: work
|
|
|
|
env_parallel --env multiline -S server multiline ::: work
|
2018-01-25 02:48:16 +00:00
|
|
|
alias multiline="dummy"
|
|
|
|
|
|
|
|
myfunc() { echo functions 'with = & " !'" '" $*; }
|
|
|
|
myfunc work
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel myfunc ::: work
|
|
|
|
env_parallel -S server myfunc ::: work
|
|
|
|
env_parallel --env myfunc myfunc ::: work
|
|
|
|
env_parallel --env myfunc -S server myfunc ::: work
|
2018-01-25 02:48:16 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
# zsh counts from 1 - not 0
|
|
|
|
echo "${myarray[1]}" "${myarray[2]}" "${myarray[3]}" "${myarray[4]}"
|
|
|
|
env_parallel -k echo '"${myarray[{}]}"' ::: 1 2 3 4
|
|
|
|
env_parallel -k -S server echo '"${myarray[{}]}"' ::: 1 2 3 4
|
|
|
|
env_parallel -k --env myarray echo '"${myarray[{}]}"' ::: 1 2 3 4
|
|
|
|
env_parallel -k --env myarray -S server echo '"${myarray[{}]}"' ::: 1 2 3 4
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2018-07-18 15:29:57 +00:00
|
|
|
env_parallel --argsep --- env_parallel -k echo ::: multi level --- env_parallel
|
|
|
|
|
2016-10-17 22:02:48 +00:00
|
|
|
env_parallel ::: true false true false
|
2017-12-03 00:40:01 +00:00
|
|
|
echo exit value $? should be 2
|
2016-10-22 11:46:01 +00:00
|
|
|
|
2018-03-06 00:32:41 +00:00
|
|
|
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`
|
2016-07-10 20:57:33 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
ssh zsh@lo "$myscript"
|
2016-07-10 20:57:33 +00:00
|
|
|
}
|
|
|
|
|
2016-07-14 07:35:39 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_ash_underscore() {
|
|
|
|
echo '### ash'
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### Testing of --env _"
|
2016-07-14 07:35:39 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
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;
|
2016-07-14 07:35:39 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
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;
|
2016-10-22 11:46:01 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
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;
|
2016-07-14 07:35:39 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
ssh ash@lo "$myscript"
|
2016-07-14 07:35:39 +00:00
|
|
|
}
|
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
par_bash_underscore() {
|
|
|
|
echo '### bash'
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### Testing of --env _"
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2016-08-01 23:34:03 +00:00
|
|
|
. `which env_parallel.bash`;
|
|
|
|
|
2016-11-06 22:01:42 +00:00
|
|
|
alias not_copied_alias="echo BAD"
|
|
|
|
not_copied_func() { echo BAD; };
|
|
|
|
not_copied_var=BAD
|
2017-04-17 14:25:58 +00:00
|
|
|
not_copied_array=(BAD BAD BAD);
|
2016-07-10 20:57:33 +00:00
|
|
|
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;
|
|
|
|
|
2016-11-06 22:01:42 +00:00
|
|
|
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;
|
|
|
|
|
2016-07-10 20:57:33 +00:00
|
|
|
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;
|
2016-07-14 07:35:39 +00:00
|
|
|
echo "OK if no myecho ^^^^^^^^^^^^^^^^^^^^^^^^^" >&2;
|
2016-07-10 20:57:33 +00:00
|
|
|
env_parallel --env _ -S server myfunc ::: work;
|
2016-07-14 07:35:39 +00:00
|
|
|
echo "OK if no myecho ^^^^^^^^^^^^^^^^^^^^^^^^^" >&2;
|
2016-07-10 20:57:33 +00:00
|
|
|
echo myfunc >> ~/.parallel/ignored_vars;
|
|
|
|
env_parallel --env _ myfunc ::: work;
|
2016-07-14 07:35:39 +00:00
|
|
|
echo "OK if no myfunc ^^^^^^^^^^^^^^^^^^^^^^^^^" >&2;
|
2016-07-10 20:57:33 +00:00
|
|
|
env_parallel --env _ -S server myfunc ::: work;
|
2016-07-14 07:35:39 +00:00
|
|
|
echo "OK if no myfunc ^^^^^^^^^^^^^^^^^^^^^^^^^" >&2;
|
2016-07-05 11:28:22 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2022-04-06 22:23:42 +00:00
|
|
|
stdout ssh bash@lo "$myscript"
|
2016-07-05 11:28:22 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_csh_underscore() {
|
|
|
|
echo '### csh'
|
2016-07-05 11:28:22 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### Testing of --env _"
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
# source `which env_parallel.csh`;
|
|
|
|
|
|
|
|
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 csh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
|
|
|
par_dash_underscore() {
|
|
|
|
echo '### dash'
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### Testing of --env _"
|
2016-08-01 23:34:03 +00:00
|
|
|
|
2016-11-06 22:01:42 +00:00
|
|
|
alias not_copied_alias="echo BAD"
|
2017-12-03 00:40:01 +00:00
|
|
|
# not_copied_func() { echo BAD; };
|
2016-11-06 22:01:42 +00:00
|
|
|
not_copied_var=BAD
|
2017-12-03 00:40:01 +00:00
|
|
|
# not_copied_array=(BAD BAD BAD);
|
|
|
|
. `which env_parallel.dash`;
|
2016-07-10 20:57:33 +00:00
|
|
|
env_parallel --record-env;
|
2017-12-03 00:40:01 +00:00
|
|
|
alias myecho="echo \$myvar aliases";
|
|
|
|
# myfunc() { myecho functions $*; };
|
2016-07-10 20:57:33 +00:00
|
|
|
myvar="variables in";
|
2017-12-03 00:40:01 +00:00
|
|
|
# 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;
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2016-11-06 22:01:42 +00:00
|
|
|
env_parallel --env _ -S server not_copied_alias ::: error=OK;
|
2017-12-03 00:40:01 +00:00
|
|
|
# env_parallel --env _ -S server not_copied_func ::: error=OK;
|
2016-11-06 22:01:42 +00:00
|
|
|
env_parallel --env _ -S server echo \$not_copied_var ::: error=OK;
|
2017-12-03 00:40:01 +00:00
|
|
|
# env_parallel --env _ -S server echo \${not_copied_array[@]} ::: error=OK;
|
2016-11-06 22:01:42 +00:00
|
|
|
|
2016-07-10 20:57:33 +00:00
|
|
|
echo myvar >> ~/.parallel/ignored_vars;
|
2017-12-03 00:40:01 +00:00
|
|
|
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;
|
2016-07-10 20:57:33 +00:00
|
|
|
echo myecho >> ~/.parallel/ignored_vars;
|
|
|
|
env_parallel --env _ myecho ::: work;
|
2017-12-03 00:40:01 +00:00
|
|
|
echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2;
|
2016-07-10 20:57:33 +00:00
|
|
|
env_parallel --env _ -S server myecho ::: work;
|
2017-12-03 00:40:01 +00:00
|
|
|
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;
|
2016-07-05 11:28:22 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
ssh dash@lo "$myscript"
|
2016-07-05 11:28:22 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_fish_underscore() {
|
|
|
|
echo '### fish'
|
2016-07-05 11:28:22 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
2018-11-22 23:30:23 +00:00
|
|
|
echo "Fish is broken"
|
2016-07-05 11:28:22 +00:00
|
|
|
echo "### Testing of --env _"
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
# . `which env_parallel.fish`;
|
2018-12-28 11:47:25 +00:00
|
|
|
true > ~/.parallel/ignored_vars;
|
2017-12-03 00:40:01 +00:00
|
|
|
|
2016-11-06 22:01:42 +00:00
|
|
|
alias not_copied_alias="echo BAD"
|
2017-12-03 00:40:01 +00:00
|
|
|
function not_copied_func
|
|
|
|
echo BAD
|
|
|
|
end
|
|
|
|
set not_copied_var "BAD";
|
|
|
|
set not_copied_array BAD BAD BAD;
|
2018-10-22 22:46:38 +00:00
|
|
|
# env_parallel --record-env;
|
|
|
|
env_parallel --session;
|
2017-12-03 00:40:01 +00:00
|
|
|
alias myecho="echo \$myvar aliases";
|
|
|
|
function myfunc
|
|
|
|
myecho $myarray functions $argv
|
|
|
|
end
|
|
|
|
set myvar "variables in";
|
|
|
|
set myarray and arrays in;
|
2016-07-10 20:57:33 +00:00
|
|
|
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;
|
|
|
|
|
2016-11-06 22:01:42 +00:00
|
|
|
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;
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel --env _ -S server echo \$not_copied_array ::: error=OK;
|
2016-11-06 22:01:42 +00:00
|
|
|
|
2018-12-28 11:47:25 +00:00
|
|
|
echo myvar > ~/.parallel/ignored_vars;
|
2016-07-10 20:57:33 +00:00
|
|
|
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;
|
2017-12-03 00:40:01 +00:00
|
|
|
echo "OK if ^^^^^^^^^^^^^^^^^ no myecho" >&2;
|
2016-07-10 20:57:33 +00:00
|
|
|
env_parallel --env _ -S server myfunc ::: work;
|
2017-12-03 00:40:01 +00:00
|
|
|
echo "OK if ^^^^^^^^^^^^^^^^^ no myecho" >&2;
|
2016-07-10 20:57:33 +00:00
|
|
|
echo myfunc >> ~/.parallel/ignored_vars;
|
|
|
|
env_parallel --env _ myfunc ::: work;
|
2017-12-03 00:40:01 +00:00
|
|
|
echo "OK if ^^^^^^^^^^^^^^^^^ no myfunc" >&2;
|
2016-07-10 20:57:33 +00:00
|
|
|
env_parallel --env _ -S server myfunc ::: work;
|
2017-12-03 00:40:01 +00:00
|
|
|
echo "OK if ^^^^^^^^^^^^^^^^^ no myfunc" >&2;
|
2016-07-05 11:28:22 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
|
|
|
|
# Old versions of fish sometimes throw up bugs all over,
|
|
|
|
# but seem to work OK otherwise. So ignore these errors.
|
|
|
|
ssh fish@lo "$myscript" 2>&1 |
|
2022-04-06 22:23:42 +00:00
|
|
|
perl -ne '/fish:|fish\(/ and next; print'
|
2016-07-05 11:28:22 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_ksh_underscore() {
|
|
|
|
echo '### ksh'
|
2016-07-14 07:35:39 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### Testing of --env _"
|
|
|
|
|
2016-11-06 22:01:42 +00:00
|
|
|
alias not_copied_alias="echo BAD"
|
|
|
|
not_copied_func() { echo BAD; };
|
|
|
|
not_copied_var=BAD
|
2017-04-17 14:25:58 +00:00
|
|
|
not_copied_array=(BAD BAD BAD);
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.ksh`;
|
2016-07-14 07:35:39 +00:00
|
|
|
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;
|
|
|
|
|
2016-11-06 22:01:42 +00:00
|
|
|
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;
|
|
|
|
|
2016-07-14 07:35:39 +00:00
|
|
|
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
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
ssh ksh@lo "$myscript"
|
2016-07-14 07:35:39 +00:00
|
|
|
}
|
|
|
|
|
2018-07-13 05:33:11 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_sh_underscore() {
|
|
|
|
echo '### sh'
|
2016-07-11 01:30:18 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### Testing of --env _"
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
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`;
|
2016-07-11 01:30:18 +00:00
|
|
|
env_parallel --record-env;
|
2017-12-03 00:40:01 +00:00
|
|
|
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;
|
2016-07-11 01:30:18 +00:00
|
|
|
env_parallel --env _ myecho ::: work;
|
|
|
|
env_parallel --env _ -S server myecho ::: work;
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
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;
|
|
|
|
|
2016-07-11 01:30:18 +00:00
|
|
|
echo myvar >> ~/.parallel/ignored_vars;
|
|
|
|
env_parallel --env _ myecho ::: work;
|
|
|
|
env_parallel --env _ -S server myecho ::: work;
|
2017-12-03 00:40:01 +00:00
|
|
|
# echo myarray >> ~/.parallel/ignored_vars;
|
|
|
|
# env_parallel --env _ myfunc ::: work;
|
|
|
|
# env_parallel --env _ -S server myfunc ::: work;
|
2016-07-11 01:30:18 +00:00
|
|
|
echo myecho >> ~/.parallel/ignored_vars;
|
|
|
|
env_parallel --env _ myecho ::: work;
|
2017-12-03 00:40:01 +00:00
|
|
|
echo "OK if no myecho ^^^^^^^^^^^^^^^^^" >&2;
|
2016-07-11 01:30:18 +00:00
|
|
|
env_parallel --env _ -S server myecho ::: work;
|
2017-12-03 00:40:01 +00:00
|
|
|
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;
|
2016-07-11 01:30:18 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
ssh sh@lo "$myscript"
|
2016-07-11 01:30:18 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_tcsh_underscore() {
|
|
|
|
echo '### tcsh'
|
2016-07-11 01:45:38 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### Testing of --env _"
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
# source `which env_parallel.tcsh`;
|
2016-07-22 21:57:23 +00:00
|
|
|
|
2016-07-11 01:45:38 +00:00
|
|
|
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
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
ssh -tt tcsh@lo "$myscript"
|
2016-07-11 01:45:38 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_zsh_underscore() {
|
|
|
|
echo '### zsh'
|
2016-07-14 07:35:39 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo "### Testing of --env _"
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.zsh`;
|
2016-11-06 22:01:42 +00:00
|
|
|
|
|
|
|
alias not_copied_alias="echo BAD"
|
2017-12-03 00:40:01 +00:00
|
|
|
not_copied_func() { echo BAD; };
|
|
|
|
not_copied_var=BAD
|
|
|
|
not_copied_array=(BAD BAD BAD);
|
2016-07-14 07:35:39 +00:00
|
|
|
env_parallel --record-env;
|
2017-12-03 00:40:01 +00:00
|
|
|
alias myecho="echo \$myvar aliases in";
|
|
|
|
eval `cat <<"_EOS";
|
|
|
|
myfunc() { myecho ${myarray[@]} functions $*; };
|
|
|
|
myvar="variables in";
|
|
|
|
myarray=(and arrays in);
|
2016-07-14 07:35:39 +00:00
|
|
|
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;
|
|
|
|
|
2016-11-06 22:01:42 +00:00
|
|
|
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;
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel --env _ -S server echo \$\{not_copied_array\[\@\]\} ::: error=OK;
|
2016-11-06 22:01:42 +00:00
|
|
|
|
2016-07-14 07:35:39 +00:00
|
|
|
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;
|
2017-12-03 00:40:01 +00:00
|
|
|
: 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;
|
2016-07-14 07:35:39 +00:00
|
|
|
echo myfunc >> ~/.parallel/ignored_vars;
|
|
|
|
env_parallel --env _ myfunc ::: work;
|
2017-12-03 00:40:01 +00:00
|
|
|
echo OK if no .^^^^^^^^^^^^^^^^^^^^^^^^^ myfunc >&2;
|
2016-07-14 07:35:39 +00:00
|
|
|
env_parallel --env _ -S server myfunc ::: work;
|
2017-12-03 00:40:01 +00:00
|
|
|
echo OK if no .^^^^^^^^^^^^^^^^^^^^^^^^^ myfunc >&2;
|
|
|
|
_EOS`
|
2016-07-14 07:35:39 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
ssh zsh@lo "$myscript"
|
2016-07-14 07:35:39 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
# Test env_parallel:
|
|
|
|
# + for each shell
|
|
|
|
# + remote, locally
|
|
|
|
# + variables, variables with funky content, arrays, assoc array, functions, aliases
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_ash_funky() {
|
2016-07-05 11:28:22 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.ash`;
|
2016-08-01 23:34:03 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
myvar="myvar works"
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
2016-07-05 11:28:22 +00:00
|
|
|
alias alias_echo="echo 3 arg";
|
2017-12-03 00:40:01 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
func_echo() {
|
|
|
|
echo $*;
|
|
|
|
echo "$myvar"
|
2017-12-03 00:40:01 +00:00
|
|
|
# echo "${myarray[5]}"
|
|
|
|
# echo ${assocarr[a]}
|
|
|
|
echo Funky-"$funky"-funky
|
2016-07-05 11:28:22 +00:00
|
|
|
}
|
2017-12-03 00:40:01 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
env_parallel alias_echo ::: alias_works
|
2017-12-03 00:40:01 +00:00
|
|
|
# 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
|
2016-07-05 11:28:22 +00:00
|
|
|
echo
|
2017-12-03 00:40:01 +00:00
|
|
|
echo "$funky" | parallel --shellquote
|
2016-07-05 11:28:22 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2016-08-01 23:34:03 +00:00
|
|
|
# Order is often different. Dunno why. So sort
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh ash@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2016-07-05 11:28:22 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_bash_funky() {
|
2016-07-05 11:28:22 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.bash`;
|
2016-08-01 23:34:03 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
myvar="myvar works"
|
2017-12-03 00:40:01 +00:00
|
|
|
funky_single_line=$(perl -e "print pack \"c*\", 13..126,128..255")
|
|
|
|
funky_multi_line=$(perl -e "print pack \"c*\", 1..12,127")
|
2016-07-05 11:28:22 +00:00
|
|
|
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"
|
2017-12-03 00:40:01 +00:00
|
|
|
echo "${myarray[5]}"
|
2016-07-05 11:28:22 +00:00
|
|
|
echo ${assocarr[a]}
|
2017-12-03 00:40:01 +00:00
|
|
|
echo Funkyline-"$funky_single_line"-funkyline
|
|
|
|
echo Funkymultiline-"$funky_multi_line"-funkymultiline
|
2016-07-05 11:28:22 +00:00
|
|
|
}
|
|
|
|
env_parallel alias_echo ::: alias_works
|
|
|
|
env_parallel func_echo ::: function_works
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel -S lo alias_echo ::: alias_works_over_ssh
|
|
|
|
env_parallel -S lo func_echo ::: function_works_over_ssh
|
2016-07-05 11:28:22 +00:00
|
|
|
echo
|
2017-12-03 00:40:01 +00:00
|
|
|
echo "$funky_single_line" | parallel --shellquote
|
|
|
|
echo "$funky_multi_line" | parallel --shellquote
|
2016-07-05 11:28:22 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2016-08-01 23:34:03 +00:00
|
|
|
# Order is often different. Dunno why. So sort
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh bash@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2016-07-05 11:28:22 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_csh_funky() {
|
2016-07-05 11:28:22 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
2017-12-03 00:40:01 +00:00
|
|
|
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'
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
#function func_echo
|
|
|
|
# echo $argv;
|
|
|
|
# echo $myvar;
|
|
|
|
# echo ${myarray[2]}
|
|
|
|
# #echo ${assocarr[a]}
|
|
|
|
# echo Funky-"$funky"-funky
|
|
|
|
#end
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
env_parallel alias_echo ::: alias_works
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
2016-07-05 11:28:22 +00:00
|
|
|
echo
|
|
|
|
echo "$funky" | parallel --shellquote
|
|
|
|
_EOF
|
|
|
|
)
|
2020-10-22 19:47:01 +00:00
|
|
|
# Sometimes the order f*cks up
|
|
|
|
stdout ssh csh@lo "$myscript" | LC_ALL=C sort
|
2016-07-05 11:28:22 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_dash_funky() {
|
2016-07-14 07:35:39 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.dash`;
|
2016-07-14 07:35:39 +00:00
|
|
|
|
|
|
|
myvar="myvar works"
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
2016-07-14 07:35:39 +00:00
|
|
|
alias alias_echo="echo 3 arg";
|
2017-12-03 00:40:01 +00:00
|
|
|
|
2016-07-14 07:35:39 +00:00
|
|
|
func_echo() {
|
|
|
|
echo $*;
|
|
|
|
echo "$myvar"
|
2017-12-03 00:40:01 +00:00
|
|
|
# echo "${myarray[5]}"
|
|
|
|
# echo ${assocarr[a]}
|
2016-07-14 07:35:39 +00:00
|
|
|
echo Funky-"$funky"-funky
|
|
|
|
}
|
|
|
|
|
|
|
|
env_parallel alias_echo ::: alias_works
|
2017-12-03 00:40:01 +00:00
|
|
|
# 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
|
2016-07-14 07:35:39 +00:00
|
|
|
echo
|
|
|
|
echo "$funky" | parallel --shellquote
|
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
# Order is often different. Dunno why. So sort
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh dash@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2016-07-14 07:35:39 +00:00
|
|
|
}
|
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
par_fish_funky() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
2018-10-22 22:46:38 +00:00
|
|
|
env_parallel --session
|
2016-07-05 11:28:22 +00:00
|
|
|
set myvar "myvar works"
|
|
|
|
setenv myenvvar "myenvvar works"
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
set funky (perl -e "print pack \"c*\", 1..255")
|
2018-12-28 11:47:25 +00:00
|
|
|
# 10 and 30 cause problems
|
|
|
|
setenv funkyenv (perl -e "print pack \"c*\", 1..9,11..29,31..255")
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
set myarray "" array_val2 3 "" 5 " space 6 "
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
# Assoc arrays do not exist
|
|
|
|
#typeset -A assocarr
|
|
|
|
#assocarr[a]=assoc_val_a
|
|
|
|
#assocarr[b]=assoc_val_b
|
|
|
|
alias alias_echo="echo 3 arg";
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
function func_echo
|
|
|
|
echo $argv;
|
|
|
|
echo "$myvar"
|
2017-12-03 00:40:01 +00:00
|
|
|
echo "$myenvvar"
|
|
|
|
echo "$myarray[6]"
|
|
|
|
# Assoc arrays do not exist in fish
|
|
|
|
# echo ${assocarr[a]}
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo Funky-"$funky"-funky
|
|
|
|
echo Funkyenv-"$funkyenv"-funkyenv
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
end
|
|
|
|
|
|
|
|
env_parallel alias_echo ::: alias_works
|
|
|
|
env_parallel func_echo ::: function_works
|
|
|
|
env_parallel -S fish@lo alias_echo ::: alias_works_over_ssh
|
|
|
|
env_parallel -S fish@lo func_echo ::: function_works_over_ssh
|
|
|
|
echo
|
|
|
|
echo "$funky" | parallel --shellquote
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh fish@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
|
|
|
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]}
|
2016-07-05 11:28:22 +00:00
|
|
|
echo Funky-"$funky"-funky
|
2017-12-03 00:40:01 +00:00
|
|
|
}
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
env_parallel alias_echo ::: alias_works
|
|
|
|
env_parallel func_echo ::: function_works
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parallel -S ksh@lo alias_echo ::: alias_works_over_ssh
|
|
|
|
env_parallel -S ksh@lo func_echo ::: function_works_over_ssh
|
2016-07-10 20:57:33 +00:00
|
|
|
echo
|
2016-07-05 11:28:22 +00:00
|
|
|
echo "$funky" | parallel --shellquote
|
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
# Order is often different. Dunno why. So sort
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh ksh@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2016-07-05 11:28:22 +00:00
|
|
|
}
|
|
|
|
|
2018-07-13 05:33:11 +00:00
|
|
|
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
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh mksh@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2018-07-13 05:33:11 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_sh_funky() {
|
2016-07-05 11:28:22 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.sh`;
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
|
|
|
}
|
2016-07-10 20:57:33 +00:00
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
env_parallel alias_echo ::: alias_works
|
2017-12-03 00:40:01 +00:00
|
|
|
# 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
|
2016-07-05 11:28:22 +00:00
|
|
|
echo
|
|
|
|
echo "$funky" | parallel --shellquote
|
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
# Order is often different. Dunno why. So sort
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh sh@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2016-07-05 11:28:22 +00:00
|
|
|
}
|
|
|
|
|
2016-07-14 07:35:39 +00:00
|
|
|
par_tcsh_funky() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
2018-10-22 22:46:38 +00:00
|
|
|
# funky breaks with different LC_ALL
|
|
|
|
setenv LC_ALL C
|
2016-07-14 07:35:39 +00:00
|
|
|
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'
|
|
|
|
|
|
|
|
# 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 tcsh@lo alias_echo ::: alias_works_over_ssh
|
|
|
|
env_parallel -S tcsh@lo alias_echo_var ::: alias_var_works_over_ssh
|
|
|
|
env_parallel -S tcsh@lo func_echo ::: function_does_not_work_over_ssh
|
|
|
|
echo
|
|
|
|
echo "$funky" | parallel --shellquote
|
|
|
|
_EOF
|
|
|
|
)
|
2016-08-01 23:34:03 +00:00
|
|
|
# Order is often different. Dunno why. So sort
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh tcsh@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2016-07-14 07:35:39 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_zsh_funky() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
|
|
|
|
. `which env_parallel.zsh`;
|
|
|
|
|
|
|
|
myvar="myvar works"
|
2018-10-22 22:46:38 +00:00
|
|
|
# Zsh-5.4.2 fails for ascii 167
|
|
|
|
funky=$(perl -e "print pack \"c*\", 1..166,168..255")
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh zsh@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2017-12-03 00:40:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
par_ash_env_parallel() {
|
2017-03-04 15:03:14 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.ash`;
|
2017-03-04 15:03:14 +00:00
|
|
|
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'
|
2017-12-01 19:53:56 +00:00
|
|
|
|
|
|
|
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
|
2017-03-04 15:03:14 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
# Order is often different. Dunno why. So sort
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh ash@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2017-03-04 15:03:14 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_bash_env_parallel() {
|
2017-03-04 15:03:14 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'bug #50435: Remote fifo broke in 20150522'
|
|
|
|
# Due to $PARALLEL_TMP being transferred
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.bash`
|
2017-03-04 15:03:14 +00:00
|
|
|
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'
|
2017-12-01 19:53:56 +00:00
|
|
|
|
|
|
|
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
|
2017-03-04 15:03:14 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
# Order is often different. Dunno why. So sort
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh bash@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2017-03-04 15:03:14 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_csh_env_parallel() {
|
2017-03-04 15:03:14 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
2017-12-03 00:40:01 +00:00
|
|
|
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`;
|
2017-03-04 15:03:14 +00:00
|
|
|
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'
|
2017-12-01 19:53:56 +00:00
|
|
|
|
|
|
|
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
|
2017-03-04 15:03:14 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
# Order is often different. Dunno why. So sort
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh dash@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2017-03-04 15:03:14 +00:00
|
|
|
}
|
|
|
|
|
2017-12-01 19:53:56 +00:00
|
|
|
par_fish_env_parallel() {
|
2017-03-04 15:03:14 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'bug #50435: Remote fifo broke in 20150522'
|
|
|
|
# Due to $PARALLEL_TMP being transferred
|
2020-06-22 22:34:52 +00:00
|
|
|
env_parallel --session
|
2017-03-04 15:03:14 +00:00
|
|
|
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'
|
2020-06-25 11:07:02 +00:00
|
|
|
echo OK: 0==$status
|
|
|
|
echo '### Test failing command with --cat'
|
|
|
|
echo data from stdin | env_parallel --pipe -S lo --cat 'cat {}; false'
|
|
|
|
echo OK: 1==$status
|
|
|
|
echo data from stdin | parallel --pipe -S lo --cat 'cat {}; false'
|
|
|
|
echo OK: 1==$status
|
2017-03-04 15:03:14 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh fish@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_ksh_env_parallel() {
|
2017-03-04 15:03:14 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.ksh`;
|
2017-03-04 15:03:14 +00:00
|
|
|
echo 'bug #50435: Remote fifo broke in 20150522'
|
|
|
|
# Due to $PARALLEL_TMP being transferred
|
2017-12-03 00:40:01 +00:00
|
|
|
OK=OK
|
2017-03-04 15:03:14 +00:00
|
|
|
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'
|
2017-12-03 00:40:01 +00:00
|
|
|
|
|
|
|
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
|
2017-03-04 15:03:14 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
# Order is often different. Dunno why. So sort
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh ksh@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2017-12-03 00:40:01 +00:00
|
|
|
}
|
|
|
|
|
2018-07-13 05:33:11 +00:00
|
|
|
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
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh mksh@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2018-07-13 05:33:11 +00:00
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
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
|
|
|
|
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
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh sh@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2017-03-04 15:03:14 +00:00
|
|
|
}
|
|
|
|
|
2017-12-01 19:53:56 +00:00
|
|
|
par_tcsh_env_parallel() {
|
2017-03-04 15:03:14 +00:00
|
|
|
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
|
|
|
|
)
|
|
|
|
# Order is often different. Dunno why. So sort
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh tcsh@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2017-03-04 15:03:14 +00:00
|
|
|
}
|
2016-07-05 11:28:22 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_zsh_env_parallel() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
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
|
2018-10-22 22:46:38 +00:00
|
|
|
ssh zsh@lo "$myscript" 2>&1 | LC_ALL=C sort
|
2017-12-03 00:40:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
par_ash_environment_too_big() {
|
2018-09-22 21:09:30 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'bug #50815: env_parallel should warn if the environment is too big'
|
2022-02-17 21:39:01 +00:00
|
|
|
len_var=63
|
|
|
|
len_var_remote=47
|
|
|
|
len_var_quote=31
|
|
|
|
len_var_quote_remote=21
|
|
|
|
len_fun=1
|
|
|
|
len_fun_remote=1
|
|
|
|
len_fun_quote=1
|
|
|
|
len_fun_quote_remote=1
|
2018-09-22 21:09:30 +00:00
|
|
|
|
|
|
|
. `which env_parallel.ash`;
|
|
|
|
|
|
|
|
repeat() {
|
|
|
|
# Repeat input string n*1000 times
|
|
|
|
perl -e 'print ((shift)x(eval "1000*(".shift.")"))' "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
bigvar=$(repeat x $len_var)
|
|
|
|
env_parallel echo ::: OK_bigvar
|
|
|
|
bigvar=$(repeat x $len_var_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_remote
|
|
|
|
|
|
|
|
bigvar=$(repeat \" $len_var_quote)
|
|
|
|
env_parallel echo ::: OK_bigvar_quote
|
|
|
|
bigvar=$(repeat \" $len_var_quote_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_remote
|
|
|
|
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc_quote
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_quote_remote
|
|
|
|
bigfunc() { true; }
|
|
|
|
|
|
|
|
echo Rest should fail - functions not supported in ash
|
|
|
|
|
|
|
|
bigvar=$(repeat x $len_var+10)
|
|
|
|
env_parallel echo ::: fail_bigvar
|
|
|
|
bigvar=$(repeat x $len_var_remote+10)
|
|
|
|
env_parallel -S lo echo ::: fail_bigvar_remote
|
|
|
|
|
|
|
|
bigvar=$(repeat \" $len_var_quote+10)
|
|
|
|
env_parallel echo ::: fail_bigvar_quote
|
|
|
|
bigvar=$(repeat \" $len_var_quote_remote+10)
|
|
|
|
env_parallel -S lo echo ::: fail_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun+10)"'"; };'
|
|
|
|
env_parallel echo ::: fail_bigfunc-not-supported
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote+10)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_remote-not-supported
|
|
|
|
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote+10)"'"; };'
|
|
|
|
env_parallel echo ::: fail_bigfunc_quote-not-supported
|
2022-02-17 21:39:01 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote+10)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_quote_remote-not-supported
|
|
|
|
|
|
|
|
bigfunc() { true; }
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh ash@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
|
|
|
par_bash_environment_too_big() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'bug #50815: env_parallel should warn if the environment is too big'
|
2020-08-07 20:20:30 +00:00
|
|
|
len_overhead=-$( (shopt;alias;typeset -f;typeset -p) | wc -c)/1000
|
2022-02-17 21:39:01 +00:00
|
|
|
len_var=$len_overhead+56
|
|
|
|
len_var_remote=$len_overhead+40
|
|
|
|
len_var_quote=$len_overhead+31
|
|
|
|
len_var_quote_remote=$len_overhead+22
|
|
|
|
len_fun=$len_overhead+56
|
|
|
|
len_fun_remote=$len_overhead+40
|
|
|
|
len_fun_quote=$len_overhead+56
|
|
|
|
len_fun_quote_remote=$len_overhead+40
|
2018-09-22 21:09:30 +00:00
|
|
|
|
|
|
|
. `which env_parallel.bash`;
|
|
|
|
|
|
|
|
repeat() {
|
|
|
|
# Repeat input string n*1000 times
|
2020-08-07 20:20:30 +00:00
|
|
|
perl -e 'print ((shift)x(eval "1000*int(".shift.")"))' "$@"
|
2018-09-22 21:09:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bigvar=$(repeat x $len_var)
|
|
|
|
env_parallel echo ::: OK_bigvar
|
|
|
|
bigvar=$(repeat x $len_var_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_remote
|
|
|
|
|
|
|
|
bigvar=$(repeat \" $len_var_quote)
|
|
|
|
env_parallel echo ::: OK_bigvar_quote
|
|
|
|
bigvar=$(repeat \" $len_var_quote_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_remote
|
|
|
|
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc_quote
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_quote_remote
|
|
|
|
bigfunc() { true; }
|
|
|
|
|
|
|
|
echo Rest should fail
|
|
|
|
|
2020-02-23 00:10:44 +00:00
|
|
|
bigvar=$(repeat x $len_var+20)
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigvar
|
2020-02-23 00:10:44 +00:00
|
|
|
bigvar=$(repeat x $len_var_remote+20)
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigvar_remote
|
|
|
|
|
2020-02-23 00:10:44 +00:00
|
|
|
bigvar=$(repeat \" $len_var_quote+20)
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigvar_quote
|
2020-02-23 00:10:44 +00:00
|
|
|
bigvar=$(repeat \" $len_var_quote_remote+20)
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
2020-02-23 00:10:44 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun+20)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigfunc
|
2020-02-23 00:10:44 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote+20)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_remote
|
|
|
|
|
2020-02-23 00:10:44 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote+20)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigfunc_quote
|
2022-02-17 21:39:01 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote+20)"'"; };'
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_quote_remote
|
|
|
|
|
|
|
|
bigfunc() { true; }
|
2017-04-17 14:25:58 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh bash@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_csh_environment_too_big() {
|
|
|
|
echo Not implemented
|
|
|
|
}
|
|
|
|
|
2017-04-17 14:25:58 +00:00
|
|
|
par_dash_environment_too_big() {
|
2018-09-22 21:09:30 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'bug #50815: env_parallel should warn if the environment is too big'
|
2022-02-17 21:39:01 +00:00
|
|
|
len_var=63
|
|
|
|
len_var_remote=47
|
|
|
|
len_var_quote=31
|
|
|
|
len_var_quote_remote=21
|
|
|
|
len_fun=1
|
|
|
|
len_fun_remote=1
|
|
|
|
len_fun_quote=1
|
|
|
|
len_fun_quote_remote=1
|
2018-09-22 21:09:30 +00:00
|
|
|
|
|
|
|
. `which env_parallel.dash`;
|
|
|
|
|
|
|
|
repeat() {
|
|
|
|
# Repeat input string n*1000 times
|
|
|
|
perl -e 'print ((shift)x(eval "1000*(".shift.")"))' "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
bigvar=$(repeat x $len_var)
|
|
|
|
env_parallel echo ::: OK_bigvar
|
|
|
|
bigvar=$(repeat x $len_var_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_remote
|
|
|
|
|
|
|
|
bigvar=$(repeat \" $len_var_quote)
|
|
|
|
env_parallel echo ::: OK_bigvar_quote
|
|
|
|
bigvar=$(repeat \" $len_var_quote_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_remote
|
|
|
|
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc_quote
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_quote_remote
|
|
|
|
bigfunc() { true; }
|
|
|
|
|
|
|
|
echo Rest should fail - functions not supported in dash
|
|
|
|
|
|
|
|
bigvar=$(repeat x $len_var+10)
|
|
|
|
env_parallel echo ::: fail_bigvar
|
|
|
|
bigvar=$(repeat x $len_var_remote+10)
|
|
|
|
env_parallel -S lo echo ::: fail_bigvar_remote
|
|
|
|
|
|
|
|
bigvar=$(repeat \" $len_var_quote+10)
|
|
|
|
env_parallel echo ::: fail_bigvar_quote
|
|
|
|
bigvar=$(repeat \" $len_var_quote_remote+10)
|
|
|
|
env_parallel -S lo echo ::: fail_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun+10)"'"; };'
|
|
|
|
env_parallel echo ::: fail_bigfunc-not-supported
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote+10)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_remote-not-supported
|
|
|
|
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote+10)"'"; };'
|
|
|
|
env_parallel echo ::: fail_bigfunc_quote-not-supported
|
2022-02-17 21:39:01 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote+10)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_quote_remote-not-supported
|
|
|
|
|
|
|
|
bigfunc() { true; }
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh dash@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_fish_environment_too_big() {
|
|
|
|
echo Not implemented
|
|
|
|
}
|
|
|
|
|
2018-09-22 21:09:30 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_ksh_environment_too_big() {
|
2018-09-22 21:09:30 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'bug #50815: env_parallel should warn if the environment is too big'
|
2020-01-09 13:37:41 +00:00
|
|
|
len_functions=-$(functions|wc -c)/1000
|
|
|
|
len_variables=-$(typeset -p | wc -c)/1000
|
2022-04-06 22:23:42 +00:00
|
|
|
len_var=$len_variables+40
|
2022-02-17 21:39:01 +00:00
|
|
|
len_var_remote=$len_variables+30
|
|
|
|
len_var_quote=$len_variables+43
|
|
|
|
len_var_quote_remote=$len_variables+30
|
|
|
|
len_fun=$len_functions+43
|
|
|
|
len_fun_remote=$len_functions+29
|
|
|
|
len_fun_quote=$len_functions+43
|
|
|
|
len_fun_quote_remote=$len_functions+29
|
|
|
|
|
2018-09-22 21:09:30 +00:00
|
|
|
. `which env_parallel.ksh`;
|
|
|
|
|
|
|
|
repeat() {
|
|
|
|
# Repeat input string n*1000 times
|
|
|
|
perl -e 'print ((shift)x(eval "1000*(".shift.")"))' "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
bigvar=$(repeat x $len_var)
|
|
|
|
env_parallel echo ::: OK_bigvar
|
|
|
|
bigvar=$(repeat x $len_var_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_remote
|
|
|
|
|
|
|
|
bigvar=$(repeat \" $len_var_quote)
|
|
|
|
env_parallel echo ::: OK_bigvar_quote
|
|
|
|
bigvar=$(repeat \" $len_var_quote_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_remote
|
|
|
|
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc_quote
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_quote_remote
|
|
|
|
bigfunc() { true; }
|
|
|
|
|
|
|
|
echo Rest should fail
|
|
|
|
|
2020-02-23 00:10:44 +00:00
|
|
|
bigvar=$(repeat x $len_var+20)
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigvar
|
2020-02-23 00:10:44 +00:00
|
|
|
bigvar=$(repeat x $len_var_remote+20)
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigvar_remote
|
|
|
|
|
2020-02-23 00:10:44 +00:00
|
|
|
bigvar=$(repeat \" $len_var_quote+20)
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigvar_quote
|
2020-02-23 00:10:44 +00:00
|
|
|
bigvar=$(repeat \" $len_var_quote_remote+20)
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
2020-02-23 00:10:44 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun+20)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigfunc
|
2020-02-23 00:10:44 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote+20)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_remote
|
|
|
|
|
2020-02-23 00:10:44 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote+20)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigfunc_quote
|
2022-02-17 21:39:01 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote+20)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_quote_remote
|
|
|
|
|
|
|
|
bigfunc() { true; }
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh ksh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2018-07-13 05:33:11 +00:00
|
|
|
par_mksh_environment_too_big() {
|
2018-09-22 21:09:30 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'bug #50815: env_parallel should warn if the environment is too big'
|
2022-02-17 21:39:01 +00:00
|
|
|
len_var=47
|
|
|
|
len_var_remote=31
|
|
|
|
len_var_quote=47
|
|
|
|
len_var_quote_remote=31
|
|
|
|
len_fun=28
|
|
|
|
len_fun_remote=13
|
|
|
|
len_fun_quote=28
|
|
|
|
len_fun_quote_remote=23
|
|
|
|
|
2018-09-22 21:09:30 +00:00
|
|
|
. `which env_parallel.mksh`;
|
|
|
|
|
|
|
|
repeat() {
|
|
|
|
# Repeat input string n*1000 times
|
|
|
|
perl -e 'print ((shift)x(eval "1000*(".shift.")"))' "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
bigvar=$(repeat x $len_var)
|
|
|
|
env_parallel echo ::: OK_bigvar
|
|
|
|
bigvar=$(repeat x $len_var_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_remote
|
|
|
|
|
|
|
|
bigvar=$(repeat \" $len_var_quote)
|
|
|
|
env_parallel echo ::: OK_bigvar_quote
|
|
|
|
bigvar=$(repeat \" $len_var_quote_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_remote
|
|
|
|
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc_quote
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_quote_remote
|
|
|
|
bigfunc() { true; }
|
|
|
|
|
|
|
|
echo Rest should fail
|
|
|
|
|
2018-12-29 20:04:58 +00:00
|
|
|
# Add 10 or 100. It differs a bit from system to system
|
|
|
|
bigvar=$(repeat x $len_var+20)
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigvar
|
|
|
|
bigvar=$(repeat x $len_var_remote+10)
|
|
|
|
env_parallel -S lo echo ::: fail_bigvar_remote
|
|
|
|
|
2018-12-29 20:04:58 +00:00
|
|
|
bigvar=$(repeat \" $len_var_quote+20)
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigvar_quote
|
2018-12-29 20:04:58 +00:00
|
|
|
bigvar=$(repeat \" $len_var_quote_remote+20)
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
2018-12-29 20:04:58 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun+20)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigfunc
|
2018-12-29 20:04:58 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote+20)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_remote
|
|
|
|
|
2018-12-29 20:04:58 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote+20)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel echo ::: fail_bigfunc_quote
|
2022-02-17 21:39:01 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote+10)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_quote_remote
|
|
|
|
|
|
|
|
bigfunc() { true; }
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh mksh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
|
|
|
par_sh_environment_too_big() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'bug #50815: env_parallel should warn if the environment is too big'
|
2022-02-17 21:39:01 +00:00
|
|
|
len_var=63
|
|
|
|
len_var_remote=47
|
|
|
|
len_var_quote=31
|
|
|
|
len_var_quote_remote=21
|
|
|
|
len_fun=1 # unsupported
|
|
|
|
len_fun_remote=1 # unsupported
|
|
|
|
len_fun_quote=1 # unsupported
|
|
|
|
len_fun_quote_remote=1 # unsupported
|
2018-09-22 21:09:30 +00:00
|
|
|
|
|
|
|
. `which env_parallel.sh`;
|
|
|
|
|
|
|
|
repeat() {
|
|
|
|
# Repeat input string n*1000 times
|
|
|
|
perl -e 'print ((shift)x(eval "1000*(".shift.")"))' "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
bigvar=$(repeat x $len_var)
|
|
|
|
env_parallel echo ::: OK_bigvar
|
|
|
|
bigvar=$(repeat x $len_var_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_remote
|
|
|
|
|
|
|
|
bigvar=$(repeat \" $len_var_quote)
|
|
|
|
env_parallel echo ::: OK_bigvar_quote
|
|
|
|
bigvar=$(repeat \" $len_var_quote_remote)
|
|
|
|
env_parallel -S lo echo ::: OK_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_remote
|
|
|
|
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote)"'"; };'
|
|
|
|
env_parallel echo ::: OK_bigfunc_quote
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_quote_remote
|
|
|
|
bigfunc() { true; }
|
|
|
|
|
|
|
|
echo Rest should fail - functions not supported in sh
|
|
|
|
|
|
|
|
bigvar=$(repeat x $len_var+10)
|
|
|
|
env_parallel echo ::: fail_bigvar
|
|
|
|
bigvar=$(repeat x $len_var_remote+10)
|
|
|
|
env_parallel -S lo echo ::: fail_bigvar_remote
|
|
|
|
|
|
|
|
bigvar=$(repeat \" $len_var_quote+10)
|
|
|
|
env_parallel echo ::: fail_bigvar_quote
|
|
|
|
bigvar=$(repeat \" $len_var_quote_remote+10)
|
|
|
|
env_parallel -S lo echo ::: fail_bigvar_quote_remote
|
|
|
|
|
|
|
|
bigvar=u
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun+10)"'"; };'
|
|
|
|
env_parallel echo ::: fail_bigfunc-not-supported
|
|
|
|
eval 'bigfunc() { a="'"$(repeat x $len_fun_remote+10)"'"; };'
|
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_remote-not-supported
|
|
|
|
|
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote+10)"'"; };'
|
|
|
|
env_parallel echo ::: fail_bigfunc_quote-not-supported
|
2022-02-17 21:39:01 +00:00
|
|
|
eval 'bigfunc() { a="'"$(repeat \" $len_fun_quote_remote+10)"'"; };'
|
2018-09-22 21:09:30 +00:00
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_quote_remote-not-supported
|
|
|
|
|
|
|
|
bigfunc() { true; }
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh sh@lo "$myscript"
|
|
|
|
}
|
2017-04-17 14:25:58 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_tcsh_environment_too_big() {
|
|
|
|
echo Not implemented
|
|
|
|
}
|
|
|
|
|
2017-04-17 14:25:58 +00:00
|
|
|
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`;
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
bigvar="$(perl -e 'print "x"x24000')"
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel echo ::: OK_bigvar
|
2018-09-22 21:09:30 +00:00
|
|
|
bigvar="$(perl -e 'print "x"x12000')"
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel -S lo echo ::: OK_bigvar_remote
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
bigvar="$(perl -e 'print "\""x24000')"
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel echo ::: OK_bigvar_quote
|
2018-09-22 21:09:30 +00:00
|
|
|
bigvar="$(perl -e 'print "\""x12000')"
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel -S lo echo ::: OK_bigvar_quote_remote
|
2017-04-17 14:25:58 +00:00
|
|
|
|
|
|
|
bigvar=u
|
2017-12-03 00:40:01 +00:00
|
|
|
eval 'bigfunc() { a="'"$(perl -e 'print "x"x24000')"'"; };'
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel echo ::: OK_bigfunc
|
2018-09-22 21:09:30 +00:00
|
|
|
eval 'bigfunc() { a="'"$(perl -e 'print "x"x12000')"'"; };'
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_remote
|
2017-04-17 14:25:58 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
eval 'bigfunc() { a="'"$(perl -e 'print "\""x24000')"'"; };'
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel echo ::: OK_bigfunc_quote
|
2018-09-22 21:09:30 +00:00
|
|
|
eval 'bigfunc() { a="'"$(perl -e 'print "\""x12000')"'"; };'
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel -S lo echo ::: OK_bigfunc_quote_remote
|
|
|
|
bigfunc() { true; }
|
|
|
|
|
|
|
|
echo Rest should fail
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
bigvar="$(perl -e 'print "x"x126000')"
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel echo ::: fail_bigvar
|
|
|
|
env_parallel -S lo echo ::: fail_bigvar_remote
|
2017-04-17 14:25:58 +00:00
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
bigvar="$(perl -e 'print "\""x127000')"
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel echo ::: fail_bigvar_quote
|
|
|
|
env_parallel -S lo echo ::: fail_bigvar_quote_remote
|
2017-04-17 14:25:58 +00:00
|
|
|
|
|
|
|
bigvar=u
|
2018-04-27 16:52:00 +00:00
|
|
|
eval 'bigfunc() { a="'"$(perl -e 'print "x"x128000')"'"; };'
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel echo ::: fail_bigfunc
|
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_remote
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
eval 'bigfunc() { a="'"$(perl -e 'print "\""x129000')"'"; };'
|
2017-11-26 15:18:55 +00:00
|
|
|
env_parallel echo ::: fail_bigfunc_quote
|
|
|
|
env_parallel -S lo echo ::: fail_bigfunc_quote_remote
|
|
|
|
|
|
|
|
bigfunc() { true; }
|
2017-04-17 14:25:58 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh zsh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_ash_parset() {
|
2017-04-17 14:25:58 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
2017-12-03 00:40:01 +00:00
|
|
|
echo 'parset'
|
|
|
|
. `which env_parallel.ash`
|
2017-11-26 15:18:55 +00:00
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-12-03 00:40:01 +00:00
|
|
|
# echo '### parset into array'
|
|
|
|
# parset arr1 echo ::: foo bar baz
|
|
|
|
# echo ${arr1[0]} ${arr1[1]} ${arr1[2]}
|
2017-04-17 14:25:58 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
echo '### parset into vars with comma'
|
|
|
|
parset comma3,comma2,comma1 echo ::: baz bar foo
|
|
|
|
echo $comma1 $comma2 $comma3
|
2017-04-17 14:25:58 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
echo '### parset into vars with space'
|
|
|
|
parset 'space3 space2 space1' echo ::: baz bar foo
|
|
|
|
echo $space1 $space2 $space3
|
2017-04-17 14:25:58 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
echo '### parset with newlines'
|
|
|
|
parset 'newline3 newline2 newline1' seq ::: 3 2 1
|
|
|
|
echo "$newline1"
|
|
|
|
echo "$newline2"
|
|
|
|
echo "$newline3"
|
2017-11-26 15:18:55 +00:00
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-12-03 00:40:01 +00:00
|
|
|
# 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]}
|
2017-11-26 15:18:55 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
echo '### env_parset'
|
|
|
|
myfun() {
|
|
|
|
myecho myfun "$@";
|
|
|
|
}
|
|
|
|
alias myecho='echo myecho "$myvar"'
|
|
|
|
myvar="myvar"
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-12-03 00:40:01 +00:00
|
|
|
# myarr=("myarr 0" "myarr 1" "myarr 2")
|
|
|
|
mynewline="`echo newline1;echo newline2;`"
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-12-03 00:40:01 +00:00
|
|
|
# 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"
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-12-03 00:40:01 +00:00
|
|
|
# env_parset 'myarray[6],myarray[5],myarray[4]' myfun ::: baz bar foo
|
|
|
|
# echo "${myarray[*]}"
|
|
|
|
# echo "${myarray[4]} ${myarray[5]} ${myarray[6]}"
|
2018-08-26 23:54:11 +00:00
|
|
|
parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2018-08-26 23:54:11 +00:00
|
|
|
env_parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2017-04-17 14:25:58 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
ssh ash@lo "$myscript"
|
2017-04-17 14:25:58 +00:00
|
|
|
}
|
|
|
|
|
2017-11-26 15:18:55 +00:00
|
|
|
par_bash_parset() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'parset'
|
|
|
|
. `which env_parallel.bash`
|
|
|
|
|
|
|
|
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"
|
2018-10-22 22:46:38 +00:00
|
|
|
env_parset 'space3 space2 space1' myfun ::: baz bar foo
|
2017-11-26 15:18:55 +00:00
|
|
|
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]}"
|
2018-08-26 23:54:11 +00:00
|
|
|
parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2018-08-26 23:54:11 +00:00
|
|
|
env_parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2017-11-26 15:18:55 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh bash@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_csh_parset() {
|
|
|
|
echo Not implemented
|
|
|
|
}
|
|
|
|
|
2017-11-26 15:18:55 +00:00
|
|
|
par_dash_parset() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'parset'
|
|
|
|
. `which env_parallel.dash`
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-11-26 15:18:55 +00:00
|
|
|
# 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"
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-11-26 15:18:55 +00:00
|
|
|
# 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"
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-11-26 15:18:55 +00:00
|
|
|
# myarr=("myarr 0" "myarr 1" "myarr 2")
|
|
|
|
mynewline="`echo newline1;echo newline2;`"
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-11-26 15:18:55 +00:00
|
|
|
# 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"
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-11-26 15:18:55 +00:00
|
|
|
# env_parset 'myarray[6],myarray[5],myarray[4]' myfun ::: baz bar foo
|
|
|
|
# echo "${myarray[*]}"
|
|
|
|
# echo "${myarray[4]} ${myarray[5]} ${myarray[6]}"
|
2018-08-26 23:54:11 +00:00
|
|
|
parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2018-08-26 23:54:11 +00:00
|
|
|
env_parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2017-11-26 15:18:55 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh dash@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_fish_parset() {
|
|
|
|
echo Not implemented
|
|
|
|
}
|
|
|
|
|
|
|
|
par_ksh_parset() {
|
2017-11-26 15:18:55 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'parset'
|
2017-12-03 00:40:01 +00:00
|
|
|
. `which env_parallel.ksh`
|
2017-11-26 15:18:55 +00:00
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
echo '### parset into array'
|
|
|
|
parset arr1 echo ::: foo bar baz
|
|
|
|
echo ${arr1[0]} ${arr1[1]} ${arr1[2]}
|
2017-11-26 15:18:55 +00:00
|
|
|
|
|
|
|
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"
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
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]}
|
2017-11-26 15:18:55 +00:00
|
|
|
|
|
|
|
echo '### env_parset'
|
|
|
|
myfun() {
|
|
|
|
myecho myfun "$@";
|
|
|
|
}
|
2017-12-03 00:40:01 +00:00
|
|
|
alias myecho='echo myecho "$myvar" "${myarr[1]}"'
|
2017-11-26 15:18:55 +00:00
|
|
|
myvar="myvar"
|
2017-12-03 00:40:01 +00:00
|
|
|
myarr=("myarr 0" "myarr 1" "myarr 2")
|
2017-11-26 15:18:55 +00:00
|
|
|
mynewline="`echo newline1;echo newline2;`"
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parset arr1 myfun ::: foo bar baz
|
|
|
|
echo "${arr1[0]} ${arr1[1]} ${arr1[2]}"
|
|
|
|
env_parset comma3,comma2,comma1 myfun ::: baz bar foo
|
2017-11-26 15:18:55 +00:00
|
|
|
echo "$comma1 $comma2 $comma3"
|
2018-10-22 22:46:38 +00:00
|
|
|
env_parset 'space3 space2 space1' myfun ::: baz bar foo
|
2017-11-26 15:18:55 +00:00
|
|
|
echo "$space1 $space2 $space3"
|
|
|
|
env_parset 'newline3 newline2 newline1' 'echo "$mynewline";seq' ::: 3 2 1
|
|
|
|
echo "$newline1"
|
|
|
|
echo "$newline2"
|
|
|
|
echo "$newline3"
|
2017-12-03 00:40:01 +00:00
|
|
|
env_parset 'myarray[6],myarray[5],myarray[4]' myfun ::: baz bar foo
|
|
|
|
echo "${myarray[*]}"
|
|
|
|
echo "${myarray[4]} ${myarray[5]} ${myarray[6]}"
|
2018-08-26 23:54:11 +00:00
|
|
|
parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2018-08-26 23:54:11 +00:00
|
|
|
env_parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2017-11-26 15:18:55 +00:00
|
|
|
_EOF
|
|
|
|
)
|
2017-12-03 00:40:01 +00:00
|
|
|
ssh ksh@lo "$myscript"
|
2017-11-26 15:18:55 +00:00
|
|
|
}
|
|
|
|
|
2018-07-13 05:33:11 +00:00
|
|
|
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'
|
2018-10-22 22:46:38 +00:00
|
|
|
# bug in mksh: Alias must be set before
|
|
|
|
alias myecho='echo myecho "$myvar" "${myarr[1]}"'
|
2018-07-13 05:33:11 +00:00
|
|
|
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"
|
2018-10-22 22:46:38 +00:00
|
|
|
env_parset 'space3 space2 space1' myfun ::: baz bar foo
|
2018-07-13 05:33:11 +00:00
|
|
|
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]}"
|
2018-08-26 23:54:11 +00:00
|
|
|
parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2018-08-26 23:54:11 +00:00
|
|
|
env_parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2018-07-13 05:33:11 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh mksh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2017-11-26 15:18:55 +00:00
|
|
|
par_sh_parset() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'parset'
|
|
|
|
. `which env_parallel.sh`
|
|
|
|
|
|
|
|
# echo '### parset into array'
|
|
|
|
# echo "Arrays not supported in all sh's"
|
|
|
|
# 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'
|
|
|
|
# echo "Arrays not supported in all sh's"
|
|
|
|
# parset 'myarray[6],myarray[5],myarray[4]' echo ::: baz bar foo
|
|
|
|
# echo ${myarray[*]}
|
|
|
|
# echo ${myarray[4]} ${myarray[5]} ${myarray[6]}
|
|
|
|
|
|
|
|
echo '### env_parset'
|
|
|
|
echo '# alias'
|
|
|
|
alias myalias='echo myalias'
|
|
|
|
env_parset alias3,alias2,alias1 myalias ::: baz bar foo
|
|
|
|
echo "$alias1"
|
|
|
|
echo "$alias2"
|
|
|
|
echo "$alias3"
|
|
|
|
|
|
|
|
# echo '# function'
|
|
|
|
# echo "Arrays not supported in all sh's"
|
|
|
|
# myfun() {
|
|
|
|
# echo myfun "$@";
|
|
|
|
# }
|
|
|
|
# env_parset fun3,fun2,fun1 myfun ::: baz bar foo
|
|
|
|
# echo "$fun1"
|
|
|
|
# echo "$fun2"
|
|
|
|
# echo "$fun3"
|
|
|
|
|
|
|
|
echo '# variable with newline'
|
|
|
|
myvar="`echo newline1;echo newline2;`"
|
|
|
|
env_parset var3,var2,var1 'echo "$myvar"' ::: baz bar foo
|
|
|
|
echo "$var1"
|
|
|
|
echo "$var2"
|
|
|
|
echo "$var3"
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-11-26 15:18:55 +00:00
|
|
|
# myarr=("myarr 0" "myarr 1" "myarr 2")
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-11-26 15:18:55 +00:00
|
|
|
# env_parset arr1 myfun ::: foo bar baz
|
|
|
|
# echo "${arr1[0]} ${arr1[1]} ${arr1[2]}"
|
|
|
|
|
|
|
|
echo '### parset into vars with comma'
|
|
|
|
env_parset comma3,comma2,comma1 echo ::: baz bar foo
|
|
|
|
echo "$comma1 $comma2 $comma3"
|
|
|
|
echo '### parset into vars with space'
|
|
|
|
env_parset 'space3 space2 space1' echo ::: baz bar foo
|
|
|
|
echo "$space1 $space2 $space3"
|
|
|
|
echo '### parset with newlines'
|
|
|
|
mynewline="`echo newline1;echo newline2;`"
|
|
|
|
env_parset 'newline3 newline2 newline1' 'echo "$mynewline";seq' ::: 3 2 1
|
|
|
|
echo "$newline1"
|
|
|
|
echo "$newline2"
|
|
|
|
echo "$newline3"
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
2017-11-26 15:18:55 +00:00
|
|
|
# env_parset 'myarray[6],myarray[5],myarray[4]' myfun ::: baz bar foo
|
|
|
|
# echo "${myarray[*]}"
|
|
|
|
# echo "${myarray[4]} ${myarray[5]} ${myarray[6]}"
|
2018-08-26 23:54:11 +00:00
|
|
|
parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2018-08-26 23:54:11 +00:00
|
|
|
env_parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2017-11-26 15:18:55 +00:00
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh sh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2017-12-03 00:40:01 +00:00
|
|
|
par_tcsh_parset() {
|
|
|
|
echo Not implemented
|
|
|
|
}
|
|
|
|
|
2017-11-26 15:18:55 +00:00
|
|
|
par_zsh_parset() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
echo 'parset'
|
|
|
|
. `which env_parallel.zsh`
|
|
|
|
eval "`cat <<"_EOS";
|
|
|
|
|
|
|
|
echo '### parset into array'
|
|
|
|
parset arr1 echo ::: foo bar baz
|
|
|
|
echo ${arr1[1]} ${arr1[2]} ${arr1[3]}
|
|
|
|
|
|
|
|
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'
|
|
|
|
alias myecho='echo myecho "$myvar" "${myarr[1]}"';
|
|
|
|
# eval is needed because zsh does not see alias in function otherwise
|
|
|
|
eval "myfun() {
|
|
|
|
myecho myfun \"\$\@\"
|
|
|
|
}"
|
|
|
|
myvar="myvar"
|
|
|
|
myarr=("myarr 0" "myarr 1" "myarr 2")
|
|
|
|
mynewline="$(echo newline1;echo newline2;)"
|
|
|
|
env_parset arr1 myfun {} ::: foo bar baz
|
|
|
|
echo "${arr1[1]}"
|
|
|
|
echo "${arr1[2]}"
|
|
|
|
echo "${arr1[3]}"
|
|
|
|
env_parset comma3,comma2,comma1 myfun ::: baz bar foo
|
|
|
|
echo "$comma1"
|
|
|
|
echo "$comma2"
|
|
|
|
echo "$comma3"
|
|
|
|
env_parset 'space3 space2 space1' myfun ::: baz bar foo
|
|
|
|
echo "$space1"
|
|
|
|
echo "$space2"
|
|
|
|
echo "$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]}"
|
2018-08-26 23:54:11 +00:00
|
|
|
parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2018-08-26 23:54:11 +00:00
|
|
|
env_parset a,b,c,d 'echo {};exit {}' ::: 0 1 1 0
|
2018-08-22 22:21:29 +00:00
|
|
|
echo Exit value 2 = $?
|
2017-11-26 15:18:55 +00:00
|
|
|
_EOS`"
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh zsh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
### env_parallel_session
|
|
|
|
|
|
|
|
par_ash_env_parallel_session() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
. `which env_parallel.ash`
|
|
|
|
echo '### Test env_parallel --session'
|
|
|
|
|
2019-01-18 15:15:47 +00:00
|
|
|
level0var=l0var
|
|
|
|
# Arrays and functions not supported
|
|
|
|
# level0arr=(level0 array)
|
|
|
|
# level0func() { echo l0func; }
|
|
|
|
alias level0alias='echo l0alias'
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level1var=l1var
|
|
|
|
# Arrays and functions not supported
|
|
|
|
# level1arr=(level1 array)
|
|
|
|
# level1func() { echo l1func; }
|
|
|
|
alias level1alias='echo l1alias'
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level2var=l2var
|
|
|
|
# Arrays and functions not supported
|
|
|
|
# level2arr=(level2 array)
|
|
|
|
# level2func() { echo l2func; }
|
|
|
|
alias level2alias='echo l2alias'
|
|
|
|
|
|
|
|
echo '### level0+1 should be hidden, level2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1+2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0+1+2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
alias aliasbefore='echo before'
|
|
|
|
# Functions not supported
|
|
|
|
# varbefore='before'
|
|
|
|
# funcbefore() { echo 'before' "$@"; }
|
|
|
|
# Arrays not supported
|
|
|
|
# arraybefore=(array before)
|
|
|
|
env_parallel --session
|
2018-07-13 05:33:11 +00:00
|
|
|
# stuff defined
|
2018-04-27 16:52:00 +00:00
|
|
|
env_parallel aliasbefore ::: must_fail
|
|
|
|
env_parallel -S lo aliasbefore ::: must_fail
|
|
|
|
# Functions not supported
|
|
|
|
# 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
|
|
|
|
# Arrays not supported
|
|
|
|
# env_parallel echo '${arraybefore[*]}' ::: no_before
|
|
|
|
# env_parallel -S lo echo '${arraybefore[*]}' ::: no_before
|
|
|
|
alias aliasafter='echo after'
|
|
|
|
varafter='after'
|
|
|
|
# Functions not supported
|
|
|
|
# funcafter() { echo 'after' "$@"; }
|
|
|
|
# Arrays not supported
|
|
|
|
# arrayafter=(array after)
|
|
|
|
env_parallel aliasafter ::: aliasafter_OK
|
|
|
|
env_parallel -S lo aliasafter ::: aliasafter_OK
|
|
|
|
# Functions not supported
|
|
|
|
# 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
|
|
|
|
# Arrays not supported
|
|
|
|
# env_parallel echo '${arrayafter[*]}' ::: arrayafter_OK
|
|
|
|
# env_parallel -S lo echo '${arrayafter[*]}' ::: arrayafter_OK
|
|
|
|
unset PARALLEL_IGNORED_NAMES
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh ash@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
|
|
|
par_bash_env_parallel_session() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
2019-01-18 15:15:47 +00:00
|
|
|
echo '### Test env_parallel --session / --end-session'
|
2018-04-27 16:52:00 +00:00
|
|
|
. `which env_parallel.bash`
|
|
|
|
|
2019-01-18 15:15:47 +00:00
|
|
|
level0var=l0var
|
|
|
|
level0arr=(level0 array)
|
|
|
|
level0func() { echo l0func; }
|
|
|
|
alias level0alias='echo l0alias'
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level1var=l1var
|
|
|
|
level1arr=(level1 array)
|
|
|
|
level1func() { echo l1func; }
|
|
|
|
alias level1alias='echo l1alias'
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level2var=l2var
|
|
|
|
level2arr=(level2 array)
|
|
|
|
level2func() { echo l2func; }
|
|
|
|
alias level2alias='echo l2alias'
|
|
|
|
|
|
|
|
echo '### level0+1 should be hidden, level2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1+2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0+1+2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
alias aliasl0='echo l0'
|
|
|
|
varl0='l0'
|
|
|
|
funcl0() { echo 'l0' "$@"; }
|
|
|
|
arrayl0=(array l0)
|
2018-04-27 16:52:00 +00:00
|
|
|
env_parallel --session
|
2018-07-13 05:33:11 +00:00
|
|
|
# stuff defined
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel aliasl0 ::: must_fail
|
|
|
|
env_parallel -S lo aliasl0 ::: must_fail
|
|
|
|
env_parallel funcl0 ::: must_fail
|
|
|
|
env_parallel -S lo funcl0 ::: must_fail
|
|
|
|
env_parallel echo '$varl0' ::: no_before
|
|
|
|
env_parallel -S lo echo '$varl0' ::: no_before
|
|
|
|
env_parallel echo '${arrayl0[*]}' ::: no_before
|
|
|
|
env_parallel -S lo echo '${arrayl0[*]}' ::: no_before
|
|
|
|
alias aliasl1='echo l1'
|
|
|
|
varl1='l1'
|
|
|
|
funcl1() { echo 'l1' "$@"; }
|
|
|
|
arrayl1=(array l1)
|
|
|
|
env_parallel aliasl1 ::: aliasl1_OK
|
|
|
|
env_parallel -S lo aliasl1 ::: aliasl1_OK
|
|
|
|
env_parallel funcl1 ::: funcl1_OK
|
|
|
|
env_parallel -S lo funcl1 ::: funcl1_OK
|
|
|
|
env_parallel echo '$varl1' ::: varl1_OK
|
|
|
|
env_parallel -S lo echo '$varl1' ::: varl1_OK
|
|
|
|
env_parallel echo '${arrayl1[*]}' ::: arrayl1_OK
|
|
|
|
env_parallel -S lo echo '${arrayl1[*]}' ::: arrayl1_OK
|
|
|
|
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
unset PARALLEL_IGNORED_NAMES
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh bash@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
|
|
|
par_csh_env_parallel_session() {
|
|
|
|
echo Not implemented
|
|
|
|
}
|
|
|
|
|
|
|
|
par_dash_env_parallel_session() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
. `which env_parallel.dash`
|
|
|
|
echo '### Test env_parallel --session'
|
|
|
|
|
2019-01-18 15:15:47 +00:00
|
|
|
level0var=l0var
|
|
|
|
# Arrays and functions not supported
|
|
|
|
# level0arr=(level0 array)
|
|
|
|
# level0func() { echo l0func; }
|
|
|
|
alias level0alias='echo l0alias'
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level1var=l1var
|
|
|
|
# Arrays and functions not supported
|
|
|
|
# level1arr=(level1 array)
|
|
|
|
# level1func() { echo l1func; }
|
|
|
|
alias level1alias='echo l1alias'
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level2var=l2var
|
|
|
|
# Arrays and functions not supported
|
|
|
|
# level2arr=(level2 array)
|
|
|
|
# level2func() { echo l2func; }
|
|
|
|
alias level2alias='echo l2alias'
|
|
|
|
|
|
|
|
echo '### level0+1 should be hidden, level2 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1+2 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0+1+2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
alias aliasbefore='echo before'
|
|
|
|
varbefore='before'
|
|
|
|
# Functions not supported
|
|
|
|
# funcbefore() { echo 'before' "$@"; }
|
|
|
|
# Arrays not supported
|
|
|
|
# arraybefore=(array before)
|
|
|
|
env_parallel --session
|
2018-07-13 05:33:11 +00:00
|
|
|
# stuff defined
|
2018-04-27 16:52:00 +00:00
|
|
|
env_parallel aliasbefore ::: must_fail
|
|
|
|
env_parallel -S lo aliasbefore ::: must_fail
|
|
|
|
# Functions not supported
|
|
|
|
# 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
|
|
|
|
# Arrays not supported
|
|
|
|
# env_parallel echo '${arraybefore[*]}' ::: no_before
|
|
|
|
# env_parallel -S lo echo '${arraybefore[*]}' ::: no_before
|
|
|
|
alias aliasafter='echo after'
|
|
|
|
varafter='after'
|
|
|
|
# Functions not supported
|
|
|
|
# funcafter() { echo 'after' "$@"; }
|
|
|
|
# Arrays not supported
|
|
|
|
# arrayafter=(array after)
|
|
|
|
env_parallel aliasafter ::: aliasafter_OK
|
|
|
|
env_parallel -S lo aliasafter ::: aliasafter_OK
|
|
|
|
# Functions not supported
|
|
|
|
# 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
|
|
|
|
# Arrays not supported
|
|
|
|
# env_parallel echo '${arrayafter[*]}' ::: arrayafter_OK
|
|
|
|
# env_parallel -S lo echo '${arrayafter[*]}' ::: arrayafter_OK
|
|
|
|
unset PARALLEL_IGNORED_NAMES
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh dash@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
|
|
|
par_fish_env_parallel_session() {
|
2018-12-29 20:04:58 +00:00
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
. (which env_parallel.fish)
|
|
|
|
|
|
|
|
echo '### Test env_parallel --session'
|
|
|
|
|
|
|
|
alias aliasbefore='echo before'
|
|
|
|
set varbefore 'before'
|
|
|
|
function funcbefore
|
|
|
|
echo 'before' "$argv"
|
|
|
|
end
|
|
|
|
set 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'
|
|
|
|
set varafter 'after'
|
|
|
|
function funcafter
|
|
|
|
echo 'after' "$argv"
|
|
|
|
end
|
|
|
|
set 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
|
|
|
|
set -e PARALLEL_IGNORED_NAMES
|
|
|
|
_EOF
|
|
|
|
)
|
2022-04-06 22:23:42 +00:00
|
|
|
ssh fish@lo "$myscript" 2>&1
|
2018-04-27 16:52:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
par_ksh_env_parallel_session() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
. `which env_parallel.ksh`
|
|
|
|
echo '### Test env_parallel --session'
|
|
|
|
|
2019-01-18 15:15:47 +00:00
|
|
|
level0var=l0var
|
|
|
|
level0arr=(level0 array)
|
|
|
|
level0func() { echo l0func; }
|
|
|
|
alias level0alias='echo l0alias'
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level1var=l1var
|
|
|
|
level1arr=(level1 array)
|
|
|
|
level1func() { echo l1func; }
|
|
|
|
alias level1alias='echo l1alias'
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level2var=l2var
|
|
|
|
level2arr=(level2 array)
|
|
|
|
level2func() { echo l2func; }
|
|
|
|
alias level2alias='echo l2alias'
|
|
|
|
|
|
|
|
echo '### level0+1 should be hidden, level2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1+2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0+1+2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
alias aliasbefore='echo before'
|
|
|
|
varbefore='before'
|
|
|
|
funcbefore() { echo 'before' "$@"; }
|
|
|
|
arraybefore=(array before)
|
|
|
|
env_parallel --session
|
2018-07-13 05:33:11 +00:00
|
|
|
# stuff defined
|
2018-04-27 16:52:00 +00:00
|
|
|
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 ksh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2018-07-13 05:33:11 +00:00
|
|
|
par_mksh_env_parallel_session() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
. `which env_parallel.mksh`
|
|
|
|
echo '### Test env_parallel --session'
|
|
|
|
|
2019-01-18 15:15:47 +00:00
|
|
|
level0var=l0var
|
|
|
|
level0arr=(level0 array)
|
|
|
|
level0func() { echo l0func; }
|
|
|
|
alias level0alias='echo l0alias'
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level1var=l1var
|
|
|
|
level1arr=(level1 array)
|
|
|
|
level1func() { echo l1func; }
|
|
|
|
alias level1alias='echo l1alias'
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level2var=l2var
|
|
|
|
level2arr=(level2 array)
|
|
|
|
level2func() { echo l2func; }
|
|
|
|
alias level2alias='echo l2alias'
|
|
|
|
|
|
|
|
echo '### level0+1 should be hidden, level2 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1+2 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0+1+2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
2018-07-13 05:33:11 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
par_sh_env_parallel_session() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
. `which env_parallel.sh`
|
|
|
|
echo '### Test env_parallel --session'
|
|
|
|
|
2019-01-18 15:15:47 +00:00
|
|
|
level0var=l0var
|
|
|
|
# level0arr=(level0 array)
|
|
|
|
level0func() { echo l0func; }
|
|
|
|
# alias level0alias='echo l0alias'
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level1var=l1var
|
|
|
|
# level1arr=(level1 array)
|
|
|
|
level1func() { echo l1func; }
|
|
|
|
# alias level1alias='echo l1alias'
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level2var=l2var
|
|
|
|
# level2arr=(level2 array)
|
|
|
|
level2func() { echo l2func; }
|
|
|
|
# alias level2alias='echo l2alias'
|
|
|
|
|
|
|
|
echo '### level0+1 should be hidden, level2 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1+2 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0+1+2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
alias aliasbefore='echo before'
|
|
|
|
varbefore='before'
|
2019-01-18 15:15:47 +00:00
|
|
|
funcbefore() { echo 'before' "$@"; }
|
2018-04-27 16:52:00 +00:00
|
|
|
# Arrays not supported
|
|
|
|
# arraybefore=(array before)
|
|
|
|
env_parallel --session
|
2018-07-13 05:33:11 +00:00
|
|
|
# stuff defined
|
2018-04-27 16:52:00 +00:00
|
|
|
env_parallel aliasbefore ::: must_fail
|
|
|
|
env_parallel -S lo aliasbefore ::: must_fail
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel funcbefore ::: must_fail
|
|
|
|
env_parallel -S lo funcbefore ::: must_fail
|
2018-04-27 16:52:00 +00:00
|
|
|
env_parallel echo '$varbefore' ::: no_before
|
|
|
|
env_parallel -S lo echo '$varbefore' ::: no_before
|
|
|
|
# Arrays not supported
|
|
|
|
# env_parallel echo '${arraybefore[*]}' ::: no_before
|
|
|
|
# env_parallel -S lo echo '${arraybefore[*]}' ::: no_before
|
|
|
|
alias aliasafter='echo after'
|
|
|
|
varafter='after'
|
|
|
|
funcafter() { echo 'after' "$@"; }
|
|
|
|
# Arrays not supported
|
|
|
|
# arrayafter=(array after)
|
|
|
|
env_parallel aliasafter ::: aliasafter_OK
|
|
|
|
env_parallel -S lo aliasafter ::: aliasafter_OK
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel funcafter ::: funcafter_OK
|
|
|
|
env_parallel -S lo funcafter ::: funcafter_OK
|
2018-04-27 16:52:00 +00:00
|
|
|
env_parallel echo '$varafter' ::: varafter_OK
|
|
|
|
env_parallel -S lo echo '$varafter' ::: varafter_OK
|
|
|
|
# Arrays not supported
|
|
|
|
# env_parallel echo '${arrayafter[*]}' ::: arrayafter_OK
|
|
|
|
# env_parallel -S lo echo '${arrayafter[*]}' ::: arrayafter_OK
|
|
|
|
unset PARALLEL_IGNORED_NAMES
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh sh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
|
|
|
par_tcsh_env_parallel_session() {
|
|
|
|
echo Not implemented
|
|
|
|
}
|
|
|
|
|
|
|
|
par_zsh_env_parallel_session() {
|
|
|
|
myscript=$(cat <<'_EOF'
|
|
|
|
. `which env_parallel.zsh`
|
|
|
|
eval "`cat <<"_EOS";
|
|
|
|
echo '### Test env_parallel --session'
|
|
|
|
|
2019-01-18 15:15:47 +00:00
|
|
|
level0var=l0var
|
|
|
|
level0arr=(level0 array)
|
|
|
|
level0func() { echo l0func; }
|
|
|
|
alias level0alias='echo l0alias'
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level1var=l1var
|
|
|
|
level1arr=(level1 array)
|
|
|
|
level1func() { echo l1func; }
|
|
|
|
alias level1alias='echo l1alias'
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --session
|
|
|
|
|
|
|
|
level2var=l2var
|
|
|
|
level2arr=(level2 array)
|
|
|
|
level2func() { echo l2func; }
|
|
|
|
alias level2alias='echo l2alias'
|
|
|
|
|
|
|
|
echo '### level0+1 should be hidden, level2 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0 should be hidden, level1+2 should be transferred'
|
2020-08-07 20:20:30 +00:00
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: fail 2>&1
|
2019-01-18 15:15:47 +00:00
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
|
|
|
env_parallel --endsession
|
|
|
|
|
|
|
|
echo '### level0+1+2 should be transferred'
|
|
|
|
env_parallel -Slo 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level0var; level0func; level0alias; echo ${level0arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level1var; level1func; level1alias; echo ${level1arr[*]}' ::: OK
|
|
|
|
env_parallel -Slo 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
env_parallel 'echo $level2var; level2func; level2alias; echo ${level2arr[*]}' ::: OK
|
|
|
|
|
2018-04-27 16:52:00 +00:00
|
|
|
alias aliasbefore='echo before'
|
|
|
|
varbefore='before'
|
|
|
|
funcbefore() { echo 'before' "$@"; }
|
|
|
|
arraybefore=(array before)
|
|
|
|
env_parallel --session
|
2018-07-13 05:33:11 +00:00
|
|
|
# stuff defined
|
2018-04-27 16:52:00 +00:00
|
|
|
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
|
|
|
|
_EOS`"
|
|
|
|
_EOF
|
|
|
|
)
|
|
|
|
ssh zsh@lo "$myscript"
|
|
|
|
}
|
|
|
|
|
2016-07-05 11:28:22 +00:00
|
|
|
export -f $(compgen -A function | grep par_)
|
2018-10-22 22:46:38 +00:00
|
|
|
|
|
|
|
# --retries 2 due to ssh_exchange_identification: read: Connection reset by peer
|
|
|
|
|
2016-07-22 21:57:23 +00:00
|
|
|
#compgen -A function | grep par_ | sort | parallel --delay $D -j$P --tag -k '{} 2>&1'
|
2017-11-26 15:18:55 +00:00
|
|
|
#compgen -A function | grep par_ | sort |
|
2018-10-22 22:46:38 +00:00
|
|
|
compgen -A function | grep par_ | LC_ALL=C sort -r |
|
2017-12-22 23:01:20 +00:00
|
|
|
# parallel --joblog /tmp/jl-`basename $0` --delay $D -j$P --tag -k '{} 2>&1'
|
2019-07-14 14:48:57 +00:00
|
|
|
# 2019-07-14 200% too high for 16 GB/4 thread
|
|
|
|
parallel --joblog /tmp/jl-`basename $0` -j75% --retries 2 --tag -k '{} 2>&1' |
|
2019-01-18 15:15:47 +00:00
|
|
|
perl -pe 's/line \d?\d\d:/line XXX:/g;
|
2018-09-22 21:09:30 +00:00
|
|
|
s/\d+ >= \d+/XXX >= XXX/;
|
2018-04-27 16:52:00 +00:00
|
|
|
s/sh:? \d?\d\d:/sh: XXX:/;
|
2019-01-18 15:15:47 +00:00
|
|
|
s/:\d?\d\d:/:XXX:/;
|
2020-05-23 18:04:09 +00:00
|
|
|
s/sh\[\d+\]/sh[XXX]/;
|
|
|
|
s/.*(tange|zenodo).*//i;
|
2020-06-22 22:34:52 +00:00
|
|
|
s:/usr/bin:/bin:g;
|
2022-04-06 22:23:42 +00:00
|
|
|
s:/tmp/par-job-\d+_.....\[\d+\]:script[9]:g;
|
|
|
|
s!/tmp/par-job-\d+_.....!script!g;
|
2020-05-23 18:04:09 +00:00
|
|
|
'
|