2007-09-10 20:28:03 +00:00
#!/bin/bash
rm -rf tmp 2>/dev/null
cp -a input-files/testdir2 tmp
2013-07-30 21:15:40 +00:00
cat <<'EOF' | sed -e 's/;$/; /;s/$SE RVER1/'$SERVER1' /; s/$SERVER2 /'$SERVER2' /' | stdout parallel -j0 -k -L1
echo '### Test filenames containing UTF-8' ;
cd tmp;
2013-08-15 17:38:39 +00:00
find . -name '*.jpg' | nice parallel -j +0 convert -geometry 120 { } { //} /thumb_{ /} ;
2013-07-30 21:15:40 +00:00
find | grep -v CVS | sort;
2007-09-10 20:28:03 +00:00
2013-07-30 21:15:40 +00:00
echo '### bug #39554: Feature request: line buffered output' ;
parallel -j0 --linebuffer 'echo -n start {};sleep 0.{#};echo middle -n {};sleep 1.{#}5;echo next to last {};sleep 1.{#};echo -n last {}' ::: A B C
echo
echo '### bug #39554: Feature request: line buffered output --tag' ;
parallel --tag -j0 --linebuffer 'echo -n start {};sleep 0.{#};echo middle -n {};sleep 1.{#}5;echo next to last {};sleep 1.{#};echo -n last {}' ::: A B C
echo
2013-08-14 18:11:00 +00:00
echo '### test round-robin' ;
2013-08-15 17:38:39 +00:00
nice seq 1000 | parallel --block 1k --pipe --round-robin wc | sort
2013-08-14 18:11:00 +00:00
echo '### --version must have higher priority than retired options'
parallel --version -g -Y -U -W -T | tail
2013-08-15 17:38:39 +00:00
echo '### bug #39787: --xargs broken'
perl -e 'for(1..30000){print "$_\n"}' | nice parallel --xargs -k echo | perl -ne 'print length $_,"\n"'
echo '### --delay should grow by 2 sec per arg'
2013-08-16 11:11:35 +00:00
stdout /usr/bin/time -f %e parallel --delay 2 true ::: 1 2 | perl -ne '$_ >= 2 and $_ <= 5 and print "OK\n"'
stdout /usr/bin/time -f %e parallel --delay 2 true ::: 1 2 3 | perl -ne '$_ >= 4 and $_ <= 7 and print "OK\n"'
echo '### Exit value should not be affected if an earlier job times out'
parallel -j2 --timeout 1 --joblog - -k ::: "sleep 10" "exit 255" | field 7
2013-08-15 17:38:39 +00:00
2013-08-17 16:24:51 +00:00
echo '### --header regexp'
( echo %head1; echo %head2; seq 5) | nice parallel -kj2 --pipe -N2 --header '(%.*\n)*' echo JOB{ #}\;cat
echo '### --header num'
( echo %head1; echo %head2; seq 5) | nice parallel -kj2 --pipe -N2 --header 2 echo JOB{ #}\;cat
echo '### --header regexp --round-robin'
( echo %head1; echo %head2; seq 5) | nice parallel -kj2 --pipe -N2 --round --header '(%.*\n)*' echo JOB{ #}\;cat
echo '### --header num --round-robin'
( echo %head1; echo %head2; seq 5) | nice parallel -kj2 --pipe -N2 --round --header 2 echo JOB{ #}\;cat
2013-07-30 21:15:40 +00:00
EOF
2007-09-10 20:28:03 +00:00
rm -rf tmp