Anonymous
public text v1 · immutable#!/bin/bash
currentdir="$(pwd)"
for i in *; do
test -d "$i" || continue
# echo entering "$i"
cd "$i"
# echo getting genre
getgenre=$(id3tool *.mp3 | grep Genre | cut -b 9- | head -n 1 | cut -d "(" -f 1 | sed -e 's/ *$//')
# echo genre got: $getgenre
# echo ""
# echo now creating directory $getgenre
cd $currentdir
mkdir "$getgenre"
# echo now moving "$i" to "$getgenre"
mv "$i" "$getgenre"
# echo now re-entering $currentdir
done