Last active
August 29, 2015 14:17
-
-
Save horshacktest/1af235d3c181064e669a to your computer and use it in GitHub Desktop.
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
## do something |
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 | |
extract_track_num () { | |
local IFS="_" | |
local splitname=($1) | |
track_num=${splitname[0]} | |
} | |
extract_track_title () { | |
local IFS="_-" | |
local splitname=($1) | |
track_title=${splitname[@] : 1 : (( ${#splitname[@]}-2 )) } | |
} | |
for file in ../*.mp3 ; do | |
echo "file is: ${file}" | |
basen=$(basename ${file%".mp3"}) | |
echo "basen is: ${basen}" | |
extract_track_num $basen | |
echo "track_num: ${track_num}" | |
extract_track_title $basen | |
echo "track_title: ${track_title}" | |
eyeD3 -Q --track $track_num -t "${track_title}" $file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment