scripts/utilities/shuffle.sh

20 lines
300 B
Bash
Executable File

extension=""
echo "Type an extension to shuffle"
read extension
to_shuffle=$(find . -name "*.${extension}");
mkdir shuffled;
for file in $to_shuffle; do
rand=$RANDOM
while test -f "shuffled/$rand.${extension}"; do
rand=$RANDOM
done
mv ${file} shuffled/$rand.${extension}
done
echo "Done"