2011-01-21 17:50:23 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-06-25 20:36:49 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2023 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
2021-03-22 20:16:35 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-01-30 21:51:56 +00:00
|
|
|
mkdir -p tmp
|
2013-03-23 20:39:48 +00:00
|
|
|
cd tmp
|
2012-05-06 10:43:40 +00:00
|
|
|
|
2014-09-20 19:36:02 +00:00
|
|
|
|
2013-03-23 20:39:48 +00:00
|
|
|
# -L1 will join lines ending in ' '
|
2018-09-20 22:15:14 +00:00
|
|
|
cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | parallel -vj0 -k --joblog /tmp/jl-`basename $0` -L1 -r
|
2013-03-23 20:39:48 +00:00
|
|
|
echo '### Bug in --load';
|
|
|
|
nice parallel -k --load 30 sleep 0.1\;echo ::: 1 2 3
|
|
|
|
|
2015-01-03 17:57:37 +00:00
|
|
|
echo '### Test --timeout'
|
2015-08-10 22:25:37 +00:00
|
|
|
nice parallel -j0 -k --timeout 2 echo {}\; sleep {}\; echo {} ::: 1.1 7.7 8.8 9.9
|
2013-03-23 20:39:48 +00:00
|
|
|
|
|
|
|
echo '### Test --joblog followed by --resume --joblog'
|
|
|
|
rm -f /tmp/joblog;
|
|
|
|
timeout -k 1 1 parallel -j2 --joblog /tmp/joblog sleep {} ::: 1.1 2.2 3.3 4.4 2>/dev/null;
|
|
|
|
parallel -j2 --resume --joblog /tmp/joblog sleep {} ::: 1.1 2.2 3.3 4.4;
|
|
|
|
cat /tmp/joblog | wc -lw;
|
|
|
|
rm -f /tmp/joblog;
|
|
|
|
|
|
|
|
echo '### Test --resume --joblog followed by --resume --joblog';
|
|
|
|
rm -f /tmp/joblog2;
|
|
|
|
timeout -k 1 1 parallel -j2 --resume --joblog /tmp/joblog2 sleep {} ::: 1.1 2.2 3.3 4.4 2>/dev/null;
|
|
|
|
parallel -j2 --resume --joblog /tmp/joblog2 sleep {} ::: 1.1 2.2 3.3 4.4;
|
|
|
|
cat /tmp/joblog2 | wc -lw;
|
|
|
|
rm -f /tmp/joblog2;
|
|
|
|
|
2015-01-03 17:57:37 +00:00
|
|
|
echo '### Test --header'
|
|
|
|
printf "a\tb\n1.2\t3/4.5" | parallel --colsep "\t" --header "\n" echo {b} {a} {b.} {b/} {b//} {b/.}
|
2013-03-23 20:39:48 +00:00
|
|
|
|
|
|
|
echo '### 64-bit wierdness - this did not complete on a 64-bit machine';
|
|
|
|
seq 1 2 | parallel -j1 'seq 1 1 | parallel true'
|
|
|
|
|
2015-01-03 17:57:37 +00:00
|
|
|
echo "### BUG-fix: bash -c 'parallel -a <(seq 1 3) echo'"
|
2013-03-23 20:39:48 +00:00
|
|
|
stdout bash -c 'parallel -k -a <(seq 1 3) echo'
|
|
|
|
|
2015-01-03 17:57:37 +00:00
|
|
|
echo "### bug #35268: shell_quote doesn't treats [] brackets correctly"
|
2013-03-23 20:39:48 +00:00
|
|
|
touch /tmp/foo1;
|
2015-02-01 13:38:26 +00:00
|
|
|
stdout parallel echo ::: '/tmp/foo[123]';
|
|
|
|
rm /tmp/foo1
|
2013-03-23 20:39:48 +00:00
|
|
|
|
2012-05-06 10:43:40 +00:00
|
|
|
|
2012-05-13 14:03:13 +00:00
|
|
|
echo '### Test bug #35820: sem breaks if $HOME is not writable'
|
2013-03-23 20:39:48 +00:00
|
|
|
echo 'Workaround: use another writable dir';
|
2018-12-29 20:04:58 +00:00
|
|
|
rm -rf /tmp/.parallel || echo /tmp/.parallel wrong owner?;
|
2013-03-23 20:39:48 +00:00
|
|
|
HOME=/tmp sem echo OK;
|
|
|
|
HOME=/tmp sem --wait;
|
2017-04-22 20:42:11 +00:00
|
|
|
ssh lo 'HOME=/usr/this/should/fail stdout sem echo should fail'
|
2013-03-23 20:39:48 +00:00
|
|
|
EOF
|