2013-12-19 01:19:19 +00:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# Simple jobs that never fails
|
|
|
|
|
# Each should be taking 0.3-1s and be possible to run in parallel
|
|
|
|
|
# I.e.: No race conditions, no logins
|
2015-01-03 17:57:37 +00:00
|
|
|
|
cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -vj0 -k --joblog /tmp/jl-`basename $0` -L1
|
2013-12-19 01:19:19 +00:00
|
|
|
|
echo '### Test exit val - true';
|
|
|
|
|
echo true | parallel;
|
|
|
|
|
echo $?
|
|
|
|
|
|
|
|
|
|
echo '**'
|
|
|
|
|
|
|
|
|
|
echo '### Test exit val - false';
|
|
|
|
|
echo false | parallel;
|
|
|
|
|
echo $?
|
|
|
|
|
|
|
|
|
|
echo '**'
|
|
|
|
|
|
2014-09-23 18:14:57 +00:00
|
|
|
|
echo '### Test bug #43284: {%} and {#} with --xapply';
|
|
|
|
|
parallel --xapply 'echo {1} {#} {%} {2}' ::: a ::: b;
|
|
|
|
|
parallel -N2 'echo {%}' ::: a b
|
|
|
|
|
|
|
|
|
|
echo '**'
|
|
|
|
|
|
2014-10-14 20:56:03 +00:00
|
|
|
|
echo '### Test bug #43376: {%} and {#} with --pipe'
|
2015-01-02 21:32:00 +00:00
|
|
|
|
echo foo | parallel -q --pipe -k echo {#}
|
|
|
|
|
echo foo | parallel --pipe -k echo {%}
|
|
|
|
|
echo foo | parallel -q --pipe -k echo {%}
|
|
|
|
|
echo foo | parallel --pipe -k echo {#}
|
2014-10-14 20:56:03 +00:00
|
|
|
|
|
|
|
|
|
echo '**'
|
|
|
|
|
|
2014-12-12 12:30:54 +00:00
|
|
|
|
echo '### {= and =} in different groups separated by space'
|
2015-01-02 21:32:00 +00:00
|
|
|
|
parallel echo {= s/a/b/ =} ::: a
|
|
|
|
|
parallel echo {= s/a/b/=} ::: a
|
|
|
|
|
parallel echo {= s/a/b/=}{= s/a/b/=} ::: a
|
|
|
|
|
parallel echo {= s/a/b/=}{=s/a/b/=} ::: a
|
|
|
|
|
parallel echo {= s/a/b/=}{= {= s/a/b/=} ::: a
|
|
|
|
|
parallel echo {= s/a/b/=}{={=s/a/b/=} ::: a
|
|
|
|
|
parallel echo {= s/a/b/ =} {={==} ::: a
|
|
|
|
|
parallel echo {={= =} ::: a
|
|
|
|
|
parallel echo {= {= =} ::: a
|
|
|
|
|
parallel echo {= {= =} =} ::: a
|
2014-12-12 12:30:54 +00:00
|
|
|
|
|
|
|
|
|
echo '**'
|
|
|
|
|
|
|
|
|
|
echo '### {} as part of the command'
|
|
|
|
|
echo p /bin/ls | parallel l{= s/p/s/ =}
|
|
|
|
|
echo /bin/ls-p | parallel --colsep '-' l{=2 s/p/s/ =} {1}
|
|
|
|
|
echo s /bin/ls | parallel l{}
|
|
|
|
|
echo /bin/ls | parallel ls {}
|
|
|
|
|
echo ls /bin/ls | parallel {}
|
|
|
|
|
echo ls /bin/ls | parallel
|
|
|
|
|
|
2014-12-14 08:44:32 +00:00
|
|
|
|
echo '**'
|
|
|
|
|
|
|
|
|
|
echo '### bug #43817: Some JP char cause problems in positional replacement strings'
|
|
|
|
|
parallel -k echo ::: '<27><<3C>>' '<27><1 $_=2<>>' 'ワ'
|
|
|
|
|
parallel -k echo {1} ::: '<27><<3C>>' '<27><1 $_=2<>>' 'ワ'
|
|
|
|
|
parallel -Xj1 echo ::: '<27><<3C>>' '<27><1 $_=2<>>' 'ワ'
|
|
|
|
|
parallel -Xj1 echo {1} ::: '<27><<3C>>' '<27><1 $_=2<>>' 'ワ'
|
|
|
|
|
|
2015-03-16 18:51:08 +00:00
|
|
|
|
echo '**'
|
|
|
|
|
|
2015-03-17 19:44:09 +00:00
|
|
|
|
echo '### --rpl % that is a substring of longer --rpl %D'
|
2015-03-16 18:51:08 +00:00
|
|
|
|
parallel --plus --rpl '%'
|
|
|
|
|
--rpl '%D $_=::shell_quote(::dirname($_));' --rpl '%B s:.*/::;s:\.[^/.]+$::;' --rpl '%E s:.*\.::'
|
|
|
|
|
'echo {}=%;echo %D={//};echo %B={/.};echo %E={+.};echo %D/%B.%E={}' ::: a.b/c.d/e.f
|
|
|
|
|
|
|
|
|
|
echo '**'
|
2014-12-14 08:44:32 +00:00
|
|
|
|
|
2015-03-17 19:44:09 +00:00
|
|
|
|
echo '### Disk full'
|
|
|
|
|
cat /dev/zero >/mnt/ram/out;
|
|
|
|
|
parallel --tmpdir /mnt/ram echo ::: OK;
|
|
|
|
|
rm /mnt/ram/out
|
|
|
|
|
|
2015-03-22 00:51:30 +00:00
|
|
|
|
echo '**'
|
|
|
|
|
|
|
|
|
|
echo '### bug #44546: If --compress-program fails: fail'
|
|
|
|
|
parallel --line-buffer --compress-program false echo \;ls ::: /no-existing; echo $?
|
|
|
|
|
parallel --tag --line-buffer --compress-program false echo \;ls ::: /no-existing; echo $?
|
|
|
|
|
(parallel --files --tag --line-buffer --compress-program false echo \;sleep 1\;ls ::: /no-existing; echo $?) | tail -n1
|
|
|
|
|
parallel --tag --compress-program false echo \;ls ::: /no-existing; echo $?
|
|
|
|
|
parallel --line-buffer --compress-program false echo \;ls ::: /no-existing; echo $?
|
|
|
|
|
parallel --compress-program false echo \;ls ::: /no-existing; echo $?
|
|
|
|
|
|
2013-12-19 01:19:19 +00:00
|
|
|
|
EOF
|