linuxbashid3eyed3

Renaming ID3 tag in Bash script with eyeD3


I have the following script that finds any file with the .mp3 extension in the incoming directory and moves it to the complete directory - it works perfectly!

#!/bin/bash
find /usr/audio/incoming -name '*.mp3' -exec mv {} /usr/audio/complete \;
exit

Now, I've installed eyeD3 (http://eyed3.nicfit.net/index.html) and I'm attempting to rename the Title tag somewhere during this entire process before it gets moved to the complete directory.

I've tried the following (and many more) but none of them work at all:

  1. Trying to do it all in the same line...

     #!/bin/bash
     find /usr/audio/incoming -name '*.mp3' eyeD3 -t "New Title" -exec mv {} /usr/audio/complete \;
     exit
    
  2. Trying to do it by splitting it up...

     #!/bin/bash
     cd /usr/audio/incoming eyeD3 -t "New Title" '*.mp3';
     find /usr/audio/incoming -name '*.mp3' -exec mv {} /usr/audio/complete \;
     exit
    
  3. Even just trying to get eyeD3 to rename the tag and nothing else...

     #!/bin/bash
     cd /usr/audio/incoming eyeD3 -t "New Title" '*.mp3';
     exit
    

I know that i'm doing something wrong, but I've searched high and low and there is virtually zero newbie support for eyeD3 that I can find. What there is out there tends to be for python scripts that don't really do what I need anyway.

Does anybody know where I'm going wrong here?

For clarity, I want to rename the tag of every single mp3 file in this directory with the same title, but all of the mp3s have different file names, which is why I'm using the wildcard instead of the file name. Maybe I'm doing this the wrong way?


Solution

  • I think this will work:

    find /usr/audio/incoming -name '*.mp3' -exec eyeD3 -t 'New Title' '{}' \; -exec mv '{}' /usr/audio/complete \;