2010-12-02 23:04:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-02-21 20:06:23 +00:00
|
|
|
SERVER1=parallel-server3
|
|
|
|
SERVER2=parallel-server2
|
|
|
|
|
|
|
|
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | parallel -j0 -k
|
2010-12-02 23:04:12 +00:00
|
|
|
echo "### Test --basenamereplace"
|
2011-01-11 12:42:14 +00:00
|
|
|
parallel -j1 -k -X --basenamereplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
2010-12-02 23:04:12 +00:00
|
|
|
parallel -k --basenamereplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
|
2011-07-16 23:46:02 +00:00
|
|
|
echo "### Test --bnr"
|
|
|
|
parallel -j1 -k -X --bnr FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
parallel -k --bnr FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
|
2010-12-02 23:04:12 +00:00
|
|
|
echo "### Test --basenameextensionreplace"
|
2011-01-11 12:42:14 +00:00
|
|
|
parallel -j1 -k -X --basenameextensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
2010-12-02 23:04:12 +00:00
|
|
|
parallel -k --basenameextensionreplace FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
|
2011-07-16 23:46:02 +00:00
|
|
|
echo "### Test --bner"
|
|
|
|
parallel -j1 -k -X --bner FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
parallel -k --bner FOO echo FOO ::: /a/b.c a/b.c b.c /a/b a/b b
|
|
|
|
|
2010-12-02 23:04:12 +00:00
|
|
|
echo "### Test {/}"
|
2011-01-11 12:42:14 +00:00
|
|
|
parallel -j1 -k -X echo {/} ::: /a/b.c a/b.c b.c /a/b a/b b
|
2010-12-02 23:04:12 +00:00
|
|
|
|
|
|
|
echo "### Test {/.}"
|
2011-01-11 12:42:14 +00:00
|
|
|
parallel -j1 -k -X echo {/.} ::: /a/b.c a/b.c b.c /a/b a/b b
|
2010-12-02 23:04:12 +00:00
|
|
|
|
|
|
|
echo "### Test {#/.}"
|
2011-01-11 12:42:14 +00:00
|
|
|
parallel -j1 -k -X echo {2/.} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
|
2010-12-02 23:04:12 +00:00
|
|
|
|
|
|
|
echo "### Test {#/}"
|
2011-01-11 12:42:14 +00:00
|
|
|
parallel -j1 -k -X echo {2/} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
|
2010-12-02 23:04:12 +00:00
|
|
|
|
|
|
|
echo "### Test {#.}"
|
2011-01-11 12:42:14 +00:00
|
|
|
parallel -j1 -k -X echo {2.} ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6
|
2012-02-21 20:06:23 +00:00
|
|
|
EOF
|
2010-12-02 23:04:12 +00:00
|
|
|
|
2010-12-04 03:06:27 +00:00
|
|
|
rm -rf tmp
|
2010-12-02 23:04:12 +00:00
|
|
|
|
2010-12-14 08:40:42 +00:00
|
|
|
echo "### Test combined -X --return {/}_{/.}_{#/.}_{#/}_{#.} with files containing space"
|
2011-01-11 12:42:14 +00:00
|
|
|
stdout parallel -j1 -k -Xv --cleanup --return tmp/{/}_{/.}_{2/.}_{2/}_{2.}/file -S parallel@$SERVER2 \
|
2010-12-02 23:04:12 +00:00
|
|
|
mkdir -p tmp/{/}_{/.}_{2/.}_{2/}_{2.} \;touch tmp/{/}_{/.}_{2/.}_{2/}_{2.}/file \
|
2010-12-14 08:40:42 +00:00
|
|
|
::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6 'number 7' 'number <8|8>'
|
2010-12-02 23:04:12 +00:00
|
|
|
find tmp
|
|
|
|
rm -rf tmp
|
2010-12-14 08:40:42 +00:00
|
|
|
|
|
|
|
echo "### Here we ought to test -m --return {/}_{/.}_{#/.}_{#/}_{#.} with files containing space"
|
|
|
|
echo "### But we will wait for a real world scenario"
|