2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test --return of weirdly named file'
|
2011-05-31 18:04:46 +00:00
|
|
|
### Test --return of weirdly named file
|
2014-07-15 00:40:38 +00:00
|
|
|
stdout parallel --return {} -vv -S parallel\@parallel-server3 echo '>'{} ::: 'aa<${#}" b'; rm 'aa<${#}" b'
|
2014-12-29 23:31:02 +00:00
|
|
|
ssh parallel@parallel-server3 'eval `echo $SHELL | grep "/t\{0,1\}csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\; PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' exec\ perl\ -e\ \'\$SIG\{CHLD\}=sub\{\$done=1\;\}\;\$pid=fork\;unless\(\$pid\)\{setpgrp\;exec\$ENV\{SHELL\},\"-c\",@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\)\'\ echo\\\ \\\>aa\\\\\\\<\\\\\\\$\\\\\\\{\\\\\\\#\\\\\\\}\\\\\\\"\\\\\\\ b;_EXIT_status=$?; mkdir -p ./.; rsync --protocol 30 --rsync-path=cd\ ././.\;\ rsync -rlDzR -essh parallel@parallel-server3:./aa\\\<\\\$\\\{\\\#\\\}\\\"\\\ b ./.; exit $_EXIT_status;
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test if remote login shell is csh'
|
2011-07-17 01:03:57 +00:00
|
|
|
### Test if remote login shell is csh
|
2014-07-15 00:40:38 +00:00
|
|
|
stdout parallel -k -vv -S csh@localhost 'echo $PARALLEL_PID $PARALLEL_SEQ {}| wc -w' ::: a b c
|
2014-12-29 23:31:02 +00:00
|
|
|
ssh csh@localhost 'eval `echo $SHELL | grep "/t\{0,1\}csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\; PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' exec\ perl\ -e\ \'\$SIG\{CHLD\}=sub\{\$done=1\;\}\;\$pid=fork\;unless\(\$pid\)\{setpgrp\;exec\$ENV\{SHELL\},\"-c\",@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\)\'\ echo\\\ \\\$PARALLEL_PID\\\ \\\$PARALLEL_SEQ\\\ a\\\|\\\ wc\\\ -w;
|
2011-07-17 01:03:57 +00:00
|
|
|
3
|
2014-12-29 23:31:02 +00:00
|
|
|
ssh csh@localhost 'eval `echo $SHELL | grep "/t\{0,1\}csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\; PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' exec\ perl\ -e\ \'\$SIG\{CHLD\}=sub\{\$done=1\;\}\;\$pid=fork\;unless\(\$pid\)\{setpgrp\;exec\$ENV\{SHELL\},\"-c\",@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\)\'\ echo\\\ \\\$PARALLEL_PID\\\ \\\$PARALLEL_SEQ\\\ b\\\|\\\ wc\\\ -w;
|
2011-07-17 01:03:57 +00:00
|
|
|
3
|
2014-12-29 23:31:02 +00:00
|
|
|
ssh csh@localhost 'eval `echo $SHELL | grep "/t\{0,1\}csh" > /dev/null && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\; PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' exec\ perl\ -e\ \'\$SIG\{CHLD\}=sub\{\$done=1\;\}\;\$pid=fork\;unless\(\$pid\)\{setpgrp\;exec\$ENV\{SHELL\},\"-c\",@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\)\'\ echo\\\ \\\$PARALLEL_PID\\\ \\\$PARALLEL_SEQ\\\ c\\\|\\\ wc\\\ -w;
|
2011-07-17 01:03:57 +00:00
|
|
|
3
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test {} multiple times in different commands'
|
2011-05-31 18:48:00 +00:00
|
|
|
### Test {} multiple times in different commands
|
2014-07-15 00:40:38 +00:00
|
|
|
seq 10 | parallel -v -Xj1 echo {} \; echo {}
|
2011-05-31 18:48:00 +00:00
|
|
|
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
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test of -X {1}-{2} with multiple input sources'
|
2011-05-31 21:12:03 +00:00
|
|
|
### Test of -X {1}-{2} with multiple input sources
|
2014-07-15 00:40:38 +00:00
|
|
|
parallel -j1 -kX echo {1}-{2} ::: a ::: b
|
2011-05-31 21:12:03 +00:00
|
|
|
a-b
|
2014-07-15 00:40:38 +00:00
|
|
|
parallel -j2 -kX echo {1}-{2} ::: a b ::: c d
|
2014-07-14 16:25:45 +00:00
|
|
|
a-c
|
|
|
|
b-c
|
2014-07-15 00:40:38 +00:00
|
|
|
parallel -j2 -kX echo {1}-{2} ::: a b c ::: d e f
|
2014-07-14 16:25:45 +00:00
|
|
|
a-d
|
|
|
|
b-f
|
2014-07-15 00:40:38 +00:00
|
|
|
parallel -j0 -kX echo {1}-{2} ::: a b c ::: d e f
|
2011-05-31 21:12:03 +00:00
|
|
|
a-d
|
|
|
|
a-e
|
|
|
|
a-f
|
|
|
|
b-d
|
|
|
|
b-e
|
|
|
|
b-f
|
|
|
|
c-d
|
|
|
|
c-e
|
|
|
|
c-f
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test of -X {}-{.} with multiple input sources'
|
2011-05-31 21:12:03 +00:00
|
|
|
### Test of -X {}-{.} with multiple input sources
|
2014-07-15 00:40:38 +00:00
|
|
|
parallel -j1 -kX echo {}-{.} ::: a ::: b
|
2011-05-31 21:12:03 +00:00
|
|
|
a-a b-b
|
2014-07-15 00:40:38 +00:00
|
|
|
parallel -j2 -kX echo {}-{.} ::: a b ::: c d
|
2011-05-31 21:12:03 +00:00
|
|
|
a-a c-c a-a d-d
|
|
|
|
b-b c-c b-b d-d
|
2014-07-15 00:40:38 +00:00
|
|
|
parallel -j2 -kX echo {}-{.} ::: a b c ::: d e f
|
2011-05-31 21:12:03 +00:00
|
|
|
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
|
2014-07-15 00:40:38 +00:00
|
|
|
parallel -j0 -kX echo {}-{.} ::: a b c ::: d e f
|
2011-05-31 21:12:03 +00:00
|
|
|
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
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test of -r with --pipe - the first should give an empty line. The second should not.'
|
2011-09-08 08:53:26 +00:00
|
|
|
### Test of -r with --pipe - the first should give an empty line. The second should not.
|
2014-07-15 00:40:38 +00:00
|
|
|
echo | parallel -j2 -N1 --pipe cat | wc -l
|
2011-09-08 08:53:26 +00:00
|
|
|
1
|
2014-07-15 00:40:38 +00:00
|
|
|
echo | parallel -r -j2 -N1 --pipe cat | wc -l
|
2011-09-08 08:53:26 +00:00
|
|
|
0
|
2014-07-15 00:40:38 +00:00
|
|
|
echo '### Test --tty'
|
2013-01-09 22:06:01 +00:00
|
|
|
### Test --tty
|
2014-07-15 00:40:38 +00:00
|
|
|
seq 0.1 0.1 0.5 | parallel -j1 --tty tty\;sleep
|
2013-01-09 22:06:01 +00:00
|
|
|
/dev/tty
|
|
|
|
/dev/tty
|
|
|
|
/dev/tty
|
|
|
|
/dev/tty
|
|
|
|
/dev/tty
|