2007-09-10 20:28:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2010-04-18 14:18:31 +00:00
|
|
|
PAR=parallel
|
|
|
|
|
2007-09-10 20:28:03 +00:00
|
|
|
rm -rf tmp 2>/dev/null
|
|
|
|
cd input-files
|
|
|
|
tar xjf random_dirs_no_newline.tar.bz2
|
|
|
|
cd ..
|
|
|
|
cp -a input-files/random_dirs_no_newline tmp
|
|
|
|
cd tmp
|
|
|
|
|
|
|
|
# tests if special dir names causes problems
|
2010-04-18 14:18:31 +00:00
|
|
|
ls | $PAR -v touch -- {}/abc-{}-{} 2>&1 | perl -e 'print sort (<>)' | md5sum
|
2007-09-10 20:28:03 +00:00
|
|
|
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'
|
2010-04-18 14:18:31 +00:00
|
|
|
ls | $PAR -v rm -- {}/abc-{}-{} 2>&1 | perl -e 'print sort (<>)' | md5sum
|
2007-09-10 20:28:03 +00:00
|
|
|
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'
|
2010-04-18 14:18:31 +00:00
|
|
|
ls | $PAR -v rmdir -- {} 2>&1 | perl -e 'print sort (<>)' | md5sum
|
2007-09-10 20:28:03 +00:00
|
|
|
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
|