mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-12-29 08:07:54 +00:00
74 lines
5.1 KiB
Plaintext
74 lines
5.1 KiB
Plaintext
echo '### Test --return of weirdly named file'
|
|
### Test --return of weirdly named file
|
|
stdout parallel --return {} -vv -S parallel\@parallel-server3 echo '>'{} ::: 'aa<${#}" b' | perl -pe 's/\S*parallel-server\S*/one-server/;s/[a-f0-9]{500,}/hex/;s/\d{5,8}/pId/g;'; rm 'aa<${#}" b'
|
|
ssh one-server exec perl\ -e\ \\\$ENV\\\{\\\"PARALLEL_PID\\\"\\\}=\\\"pId\\\"\\\;\\\$ENV\\\{\\\"PARALLEL_SEQ\\\"\\\}=\\\"1\\\"\\\;\\\$bashfunc\\\ =\\\ \\\"\\\"\\\;@ARGV=\\\"echo\\\ \\\>aa\\\\\\\\\\\<\\\\\\\\\\\\\\\$\\\\\\\\\\\{\\\\\\\\\\\#\\\\\\\\\\\}\\\\\\\\\\\\\\\"\\\\\\\\\\\ b\\\"\\\;\\\$SIG\\\{CHLD\\\}=sub\\\{\\\$done=1\\\;\\\}\\\;\\\$pid=fork\\\;unless\\\(\\\$pid\\\)\\\{setpgrp\\\;exec\\\$ENV\\\{SHELL\\\},\\\"-c\\\",\\\(\\\$bashfunc.\\\"@ARGV\\\"\\\)\\\;die\\\"exec:\\\$\\\!\\\\n\\\"\\\;\\\}do\\\{\\\$s=\\\$s\\\<1\\\?0.001+\\\$s\\\*1.03:\\\$s\\\;select\\\(undef,undef,undef,\\\$s\\\)\\\;\\\}until\\\(\\\$done\\\|\\\|getppid==1\\\)\\\;kill\\\(SIGHUP,-\\\$\\\{pid\\\}\\\)unless\\\$done\\\;wait\\\;exit\\\(\\\$\\\?\\\&127\\\?128+\\\(\\\$\\\?\\\&127\\\):1+\\\$\\\?\\\>\\\>8\\\);_EXIT_status=$?; mkdir -p ./.; rsync --protocol 30 --rsync-path=cd\ ././.\;\ rsync -rlDzR -essh parallel@parallel-server3:./aa\\\<\\\$\\\{\\\#\\\}\\\"\\\ b ./.; exit $_EXIT_status;
|
|
echo '### Test if remote login shell is csh'
|
|
### Test if remote login shell is csh
|
|
stdout parallel -k -vv -S csh@localhost 'echo $PARALLEL_PID $PARALLEL_SEQ {}| wc -w' ::: a b c | perl -pe 's/\S*parallel-server\S*/one-server/;s/[a-f0-9]{500,}/hex/;s/\d{5,8}/pId/g;'
|
|
ssh csh@localhost exec perl\ -e\ \\\$ENV\\\{\\\"PARALLEL_PID\\\"\\\}=\\\"pId\\\"\\\;\\\$ENV\\\{\\\"PARALLEL_SEQ\\\"\\\}=\\\"1\\\"\\\;\\\$bashfunc\\\ =\\\ \\\"\\\"\\\;@ARGV=\\\"echo\\\ \\\\\\\$PARALLEL_PID\\\ \\\\\\\$PARALLEL_SEQ\\\ a\\\|\\\ wc\\\ -w\\\"\\\;\\\$SIG\\\{CHLD\\\}=sub\\\{\\\$done=1\\\;\\\}\\\;\\\$pid=fork\\\;unless\\\(\\\$pid\\\)\\\{setpgrp\\\;exec\\\$ENV\\\{SHELL\\\},\\\"-c\\\",\\\(\\\$bashfunc.\\\"@ARGV\\\"\\\)\\\;die\\\"exec:\\\$\\\!\\\\n\\\"\\\;\\\}do\\\{\\\$s=\\\$s\\\<1\\\?0.001+\\\$s\\\*1.03:\\\$s\\\;select\\\(undef,undef,undef,\\\$s\\\)\\\;\\\}until\\\(\\\$done\\\|\\\|getppid==1\\\)\\\;kill\\\(SIGHUP,-\\\$\\\{pid\\\}\\\)unless\\\$done\\\;wait\\\;exit\\\(\\\$\\\?\\\&127\\\?128+\\\(\\\$\\\?\\\&127\\\):1+\\\$\\\?\\\>\\\>8\\\);
|
|
3
|
|
ssh csh@localhost exec perl\ -e\ \\\$ENV\\\{\\\"PARALLEL_PID\\\"\\\}=\\\"pId\\\"\\\;\\\$ENV\\\{\\\"PARALLEL_SEQ\\\"\\\}=\\\"2\\\"\\\;\\\$bashfunc\\\ =\\\ \\\"\\\"\\\;@ARGV=\\\"echo\\\ \\\\\\\$PARALLEL_PID\\\ \\\\\\\$PARALLEL_SEQ\\\ b\\\|\\\ wc\\\ -w\\\"\\\;\\\$SIG\\\{CHLD\\\}=sub\\\{\\\$done=1\\\;\\\}\\\;\\\$pid=fork\\\;unless\\\(\\\$pid\\\)\\\{setpgrp\\\;exec\\\$ENV\\\{SHELL\\\},\\\"-c\\\",\\\(\\\$bashfunc.\\\"@ARGV\\\"\\\)\\\;die\\\"exec:\\\$\\\!\\\\n\\\"\\\;\\\}do\\\{\\\$s=\\\$s\\\<1\\\?0.001+\\\$s\\\*1.03:\\\$s\\\;select\\\(undef,undef,undef,\\\$s\\\)\\\;\\\}until\\\(\\\$done\\\|\\\|getppid==1\\\)\\\;kill\\\(SIGHUP,-\\\$\\\{pid\\\}\\\)unless\\\$done\\\;wait\\\;exit\\\(\\\$\\\?\\\&127\\\?128+\\\(\\\$\\\?\\\&127\\\):1+\\\$\\\?\\\>\\\>8\\\);
|
|
3
|
|
ssh csh@localhost exec perl\ -e\ \\\$ENV\\\{\\\"PARALLEL_PID\\\"\\\}=\\\"pId\\\"\\\;\\\$ENV\\\{\\\"PARALLEL_SEQ\\\"\\\}=\\\"3\\\"\\\;\\\$bashfunc\\\ =\\\ \\\"\\\"\\\;@ARGV=\\\"echo\\\ \\\\\\\$PARALLEL_PID\\\ \\\\\\\$PARALLEL_SEQ\\\ c\\\|\\\ wc\\\ -w\\\"\\\;\\\$SIG\\\{CHLD\\\}=sub\\\{\\\$done=1\\\;\\\}\\\;\\\$pid=fork\\\;unless\\\(\\\$pid\\\)\\\{setpgrp\\\;exec\\\$ENV\\\{SHELL\\\},\\\"-c\\\",\\\(\\\$bashfunc.\\\"@ARGV\\\"\\\)\\\;die\\\"exec:\\\$\\\!\\\\n\\\"\\\;\\\}do\\\{\\\$s=\\\$s\\\<1\\\?0.001+\\\$s\\\*1.03:\\\$s\\\;select\\\(undef,undef,undef,\\\$s\\\)\\\;\\\}until\\\(\\\$done\\\|\\\|getppid==1\\\)\\\;kill\\\(SIGHUP,-\\\$\\\{pid\\\}\\\)unless\\\$done\\\;wait\\\;exit\\\(\\\$\\\?\\\&127\\\?128+\\\(\\\$\\\?\\\&127\\\):1+\\\$\\\?\\\>\\\>8\\\);
|
|
3
|
|
echo '### Test {} multiple times in different commands'
|
|
### Test {} multiple times in different commands
|
|
seq 10 | parallel -v -Xj1 echo {} \; echo {}
|
|
echo 1 2 3 4 5 6 7 8 9 10 ; echo 1 2 3 4 5 6 7 8 9 10
|
|
1 2 3 4 5 6 7 8 9 10
|
|
1 2 3 4 5 6 7 8 9 10
|
|
echo '### Test of -X {1}-{2} with multiple input sources'
|
|
### Test of -X {1}-{2} with multiple input sources
|
|
parallel -j1 -kX echo {1}-{2} ::: a ::: b
|
|
a-b
|
|
parallel -j2 -kX echo {1}-{2} ::: a b ::: c d
|
|
a-c
|
|
b-c
|
|
parallel -j2 -kX echo {1}-{2} ::: a b c ::: d e f
|
|
a-d
|
|
b-f
|
|
parallel -j0 -kX echo {1}-{2} ::: a b c ::: d e f
|
|
a-d
|
|
a-e
|
|
a-f
|
|
b-d
|
|
b-e
|
|
b-f
|
|
c-d
|
|
c-e
|
|
c-f
|
|
echo '### Test of -X {}-{.} with multiple input sources'
|
|
### Test of -X {}-{.} with multiple input sources
|
|
parallel -j1 -kX echo {}-{.} ::: a ::: b
|
|
a-a b-b
|
|
parallel -j2 -kX echo {}-{.} ::: a b ::: c d
|
|
a-a c-c a-a d-d
|
|
b-b c-c b-b d-d
|
|
parallel -j2 -kX echo {}-{.} ::: a b c ::: d e f
|
|
a-a d-d a-a e-e a-a f-f b-b d-d b-b e-e
|
|
b-b f-f c-c d-d c-c e-e c-c f-f
|
|
parallel -j0 -kX echo {}-{.} ::: a b c ::: d e f
|
|
a-a d-d
|
|
a-a e-e
|
|
a-a f-f
|
|
b-b d-d
|
|
b-b e-e
|
|
b-b f-f
|
|
c-c d-d
|
|
c-c e-e
|
|
c-c f-f
|
|
echo '### Test of -r with --pipe - the first should give an empty line. The second should not.'
|
|
### Test of -r with --pipe - the first should give an empty line. The second should not.
|
|
echo | parallel -j2 -N1 --pipe cat | wc -l
|
|
1
|
|
echo | parallel -r -j2 -N1 --pipe cat | wc -l
|
|
0
|
|
echo '### Test --tty'
|
|
### Test --tty
|
|
seq 0.1 0.1 0.5 | parallel -j1 --tty tty\;sleep
|
|
/dev/tty
|
|
/dev/tty
|
|
/dev/tty
|
|
/dev/tty
|
|
/dev/tty
|