2007-09-10 20:28:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-12-26 22:29:28 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2022 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
|
|
|
|
|
2013-12-19 01:19:19 +00:00
|
|
|
TMP=/run/shm/parallel_local105
|
2012-05-24 00:03:57 +00:00
|
|
|
rm -rf $TMP 2>/dev/null
|
|
|
|
mkdir -p $TMP
|
|
|
|
tar -C $TMP -xf input-files/random_dirs_with_newline.tar.bz2
|
|
|
|
|
|
|
|
cd $TMP/random_dirs_with_newline
|
2007-09-10 20:28:03 +00:00
|
|
|
|
|
|
|
# tests if special dir names causes problems
|
2011-09-16 13:26:17 +00:00
|
|
|
find . -type d -print0 | perl -0 -pe 's:^./::' | parallel -0 -v touch -- {}/abc-{}-{} 2>&1 \
|
2007-09-10 20:28:03 +00:00
|
|
|
| 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'
|
2011-09-16 13:26:17 +00:00
|
|
|
find . -type d -print0 | perl -0 -pe 's:^./::' | parallel -0 -v rm -- {}/abc-{}-{} 2>&1 \
|
2007-09-10 20:28:03 +00:00
|
|
|
| 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'
|
2011-09-16 13:26:17 +00:00
|
|
|
find . -type d -print0 | perl -0 -pe 's:^./::' | parallel -0 -v rmdir -- {} 2>&1 \
|
2007-09-10 20:28:03 +00:00
|
|
|
| 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 ..
|
2012-05-24 00:03:57 +00:00
|
|
|
rm -rf $TMP
|
|
|
|
|