-
-
Save denzuko/6847188 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/bin/bash | |
| ############################################################################### | |
| # | |
| # renamemp3 - Version 1.0 | |
| # Copyrighted (c)2013 Dwight Spencer (@denzuko) <[email protected]> | |
| # All Rights Reserved. Licenced under OSI MIT licence. | |
| # | |
| # renames files in a directory given by parameters to append '.mp3' | |
| # | |
| ############################################################################### | |
| usage() { | |
| echo "${0} [directory] <regex>" | |
| return 0 | |
| } | |
| rename_mp3() { | |
| find "${1:.}" -type f -name "${2:*}" -print0 | xargs -0 -P4 -I{} mv {} {}.mp3 | |
| } | |
| alias main=rename_mp3 | |
| [[ -z $@ ]] && usage || main $* | |
| ############################################################################### | |
| # vim: syntax=sh |
Author
Author
Updated to work as a library
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added safety messures.