parallel/testsuite/tests-to-run/test05.sh
Ole Tange d0f6c9a0aa parallel: { and } were not quoted correctly so this would fail:
echo a b | parallel --pipe -q awk '{print $2, $1}'
2011-09-16 15:26:17 +02:00

37 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
rm -rf tmp 2>/dev/null
cd input-files
tar xjf random_dirs_with_newline.tar.bz2
cd ..
cp -a input-files/random_dirs_with_newline tmp
cd tmp
# tests if special dir names causes problems
find . -type d -print0 | perl -0 -pe 's:^./::' | parallel -0 -v touch -- {}/abc-{}-{} 2>&1 \
| perl -e 'print sort (<>)' | md5sum
echo -n 'There are '
find . -type d -print0 | perl -0 -ne '$a++;END{print $a}'
echo -n ' dirs with '
find . -type f -print0 | perl -0 -ne '$a++;END{print $a}'
echo ' files'
echo 'Removing files'
find . -type d -print0 | perl -0 -pe 's:^./::' | parallel -0 -v rm -- {}/abc-{}-{} 2>&1 \
| perl -e 'print sort (<>)' | md5sum
echo -n 'There are '
find . -type d -print0 | perl -0 -ne '$a++;END{print $a}'
echo -n ' dirs with '
find . -type f -print0 | perl -0 -ne '$a++;END{print $a}'
echo ' files'
echo 'Removing dirs'
find . -type d -print0 | perl -0 -pe 's:^./::' | parallel -0 -v rmdir -- {} 2>&1 \
| perl -e 'print sort (<>)' | md5sum
echo -n 'There are '
find . -type d -print0 | perl -0 -ne '$a++;END{print $a}'
echo -n ' dirs with '
find . -type f -print0 | perl -0 -ne '$a++;END{print $a}'
echo ' files'
cd ..
rm -rf tmp