Last active
December 20, 2015 00:49
-
-
Save godDLL/6044957 to your computer and use it in GitHub Desktop.
MP3 shuffling script meant for use with portable players that lack the capability, like the Mighty DWARF. Place in a folder with all your MP3s to shuffle, and they will get renamed pretty randomly. Can be launched multiple times, ignores files with *.command extension, ignores subfolder contents (renames subfolders, could be used for "album shuf…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# mp3 shuffling script for portable players that lack it | |
# put in a folder with target files, they will be renamed | |
cd "$(dirname "$0")" | |
D=$(date "+%s") | |
for N in *; do | |
test "${N##*.}" = "command" && continue # don't rename our script | |
X=$(md5<<< "$D$N").${N##*.} | |
test -f "$N" && test -f "$X" || (mv "$N" "$X" && echo mv "$N" "$X") | |
done | |
echo "Press ENTER to close..." | |
read |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment