2009-11-10 14:14:15 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-06-14 20:10:39 +00:00
|
|
|
cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -j0 -k -L1
|
|
|
|
echo "### Test -I"
|
2010-09-21 20:00:30 +00:00
|
|
|
seq 1 10 | parallel -k 'seq 1 {} | parallel -k -I :: echo {} ::'
|
2009-11-10 14:14:15 +00:00
|
|
|
|
2012-06-14 20:10:39 +00:00
|
|
|
echo "### Test -X -I"
|
2011-01-17 12:38:58 +00:00
|
|
|
seq 1 10 | parallel -k 'seq 1 {} | parallel -j1 -X -k -I :: echo a{} b::'
|
2009-11-10 14:14:15 +00:00
|
|
|
|
2012-06-14 20:10:39 +00:00
|
|
|
echo "### Test -m -I"
|
2011-01-17 12:38:58 +00:00
|
|
|
seq 1 10 | parallel -k 'seq 1 {} | parallel -j1 -m -k -I :: echo a{} b::'
|
2009-11-10 14:14:15 +00:00
|
|
|
|
2012-06-14 20:10:39 +00:00
|
|
|
echo "### Test max line length -m -I"
|
|
|
|
seq 1 60000 | parallel -I :: -m -j1 echo a::b::c |
|
|
|
|
mop -q "|sort |md5sum" :par1;
|
|
|
|
export CHAR=$(cat ~/.mop/:par1 | wc -c);
|
|
|
|
export LINES=$(cat ~/.mop/:par1 | wc -l);
|
|
|
|
echo -n "Chars per line ($CHAR/$LINES): ";
|
|
|
|
echo "$CHAR/$LINES" | bc
|
2009-11-10 14:14:15 +00:00
|
|
|
|
2012-06-14 20:10:39 +00:00
|
|
|
echo "### Test max line length -X -I"
|
|
|
|
seq 1 60000 | parallel -I :: -X -j1 echo a::b::c |
|
|
|
|
mop -q "|sort |md5sum" :par;
|
|
|
|
export CHAR=$(cat ~/.mop/:par | wc -c);
|
|
|
|
export LINES=$(cat ~/.mop/:par | wc -l);
|
|
|
|
echo -n "Chars per line ($CHAR/$LINES): ";
|
|
|
|
echo "$CHAR/$LINES" | bc
|
|
|
|
|
|
|
|
echo "### bug #36659: --sshlogin strips leading slash from ssh command"
|
|
|
|
parallel --sshlogin '/usr/bin/ssh localhost' echo ::: OK
|
2012-06-14 20:19:49 +00:00
|
|
|
|
|
|
|
echo "### bug #36660: --workdir mkdir does not use --sshlogin custom ssh"
|
|
|
|
cd /tmp; echo OK > parallel_test.txt;
|
|
|
|
ssh () { echo Failed; };
|
|
|
|
export -f ssh;
|
|
|
|
parallel --workdir /tmp/foo/bar --transfer --sshlogin '/usr/bin/ssh localhost' cat ::: parallel_test.txt;
|
|
|
|
|
2012-06-14 20:30:24 +00:00
|
|
|
echo "bug #36657: --load does not work with custom ssh"
|
|
|
|
cd /tmp; echo OK > parallel_test.txt;
|
|
|
|
ssh () { echo Failed; };
|
|
|
|
export -f ssh;
|
|
|
|
parallel --load=1000% -S "/usr/bin/ssh localhost" echo ::: OK
|
|
|
|
|
2012-06-14 21:13:11 +00:00
|
|
|
echo "bug #34958: --pipe with record size measured in lines"
|
|
|
|
seq 10 | parallel --pipe -L 4 cat\;echo FOO
|
|
|
|
|
|
|
|
echo "bug #34958: --pipe with record size measured in lines"
|
|
|
|
seq 10 | parallel --pipe -l 4 cat\;echo FOO
|
|
|
|
|
2012-06-14 20:10:39 +00:00
|
|
|
EOF
|