scripts/utilities/shuffle.sh

20 lines
300 B
Bash
Raw Normal View History

2023-02-07 00:07:05 +03:00
extension=""
echo "Type an extension to shuffle"
read extension
to_shuffle=$(find . -name "*.${extension}");
mkdir shuffled;
for file in $to_shuffle; do
rand=$RANDOM
2023-02-07 00:10:20 +03:00
while test -f "shuffled/$rand.${extension}"; do
rand=$RANDOM
done
2023-02-07 00:07:05 +03:00
mv ${file} shuffled/$rand.${extension}
done
echo "Done"