mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-25 23:47:53 +00:00
65 lines
1.8 KiB
Bash
65 lines
1.8 KiB
Bash
#!/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
|
||
cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -k -vj4 -L1
|
||
echo '### Test exit val - true';
|
||
echo true | parallel;
|
||
echo $?
|
||
|
||
echo '**'
|
||
|
||
echo '### Test exit val - false';
|
||
echo false | parallel;
|
||
echo $?
|
||
|
||
echo '**'
|
||
|
||
echo '### Test bug #43284: {%} and {#} with --xapply';
|
||
parallel --xapply 'echo {1} {#} {%} {2}' ::: a ::: b;
|
||
parallel -N2 'echo {%}' ::: a b
|
||
|
||
echo '**'
|
||
|
||
echo '### Test bug #43376: {%} and {#} with --pipe'
|
||
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 {#}
|
||
|
||
echo '**'
|
||
|
||
echo '### {= and =} in different groups separated by space'
|
||
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
|
||
|
||
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
|
||
|
||
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<>>' 'ワ'
|
||
|
||
|
||
EOF
|