scripts/utilities/shuffle.sh

22 lines
313 B
Bash
Raw Normal View History

2023-02-12 02:48:51 +03:00
#!/bin/bash
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"