Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- mkdir misc
- for i in *.mp3
- do
- echo "$i"
- #move all file without tags to "misc" folder
- x="$(id3tool "$i"|head -n2|tail -n1)";
- if [ "$x" = "No ID3 Tag" ];
- then
- mv "$i" misc
- fi
- #get tag info, create folders, move mp3
- TITLE="`id3tool "$i" | grep '^Song Title:' | awk '{ for (i=3;i<=NF;i++) { printf $i } }'`"
- ARTIST="`id3tool "$i" | grep '^Artist:' | awk '{ for (i=2;i<=NF;i++) { printf $i } }'`"
- ALBUM="`id3tool "$i" | grep '^Album:' | awk '{ for (i=2;i<=NF;i++) { printf $i } }'`"
- YEAR="`id3tool "$i" | grep '^Year:' | awk '{ for (i=2;i<=NF;i++) { printf $i } }'`"
- TRACKNUM="`id3tool "$i" | grep '^Year:' | awk '{ print $2 }'`"
- dir="$ARTIST/$ALBUM/"
- mkdir -p "$dir"
- mv "$i" "$dir"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement