From 6c4ce4b4c95bb521c6a9d172eda16dd9fc40987e Mon Sep 17 00:00:00 2001 From: leca Date: Tue, 7 Feb 2023 00:07:05 +0300 Subject: [PATCH] added shuffle.sh --- utilities/shuffle.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 utilities/shuffle.sh diff --git a/utilities/shuffle.sh b/utilities/shuffle.sh new file mode 100755 index 0000000..5da1fc3 --- /dev/null +++ b/utilities/shuffle.sh @@ -0,0 +1,16 @@ +extension="" + +echo "Type an extension to shuffle" +read extension + +to_shuffle=$(find . -name "*.${extension}"); + +mkdir shuffled; + +for file in $to_shuffle; do + rand=$RANDOM + mv ${file} shuffled/$rand.${extension} +done + +echo "Done" +