Results 1 to 8 of 8

Thread: Bash script for sorting mp3's.

  1. #1

    Bash script for sorting mp3's.

    I have all of my songs in one dir (/media/audio) They are all named in the way 'artist - songname.mp3/ogg' Is someone able to provide the code for me to be able to

    a) take $artist, make a dir for the artist with the $artist variable if there are more than 2 songs by that artist
    b) move the songs with 2 or more songs by that artist to the dir created from the artists name
    c) move the songs that didn't have another song by the same artist to a serperate dir (eg, misc)

    Its a bit to complicated for me to even attempt. Could someone possibly write a script for me?

  2. #2
    Guest

    Re: Bash script for sorting mp3's.

    http://www.linuxdoc.org/LDP/abs/html/index.html
    this is a Bash Scripting guide

    learn it urself, it will only benefit u

  3. #3

    Re: Bash script for sorting mp3's.

    Okay, will give it a try. Will probably just be quicker to create all the dir's and move the songs myself. ;D

  4. #4
    Guest

    Re: Bash script for sorting mp3's.


    Okay, will give it a try. Will probably just be quicker to create all the dir's and move the songs myself. *;D
    probably
    but learning about bash scripting is really something i recommend to everyone. u don't have to become an expert at it, but just some basic knowledge about it could help u out in a lot of situations

  5. #5

    Re: Bash script for sorting mp3's.

    Yeah, I know what you mean. Saves trying to learn it when I REALLY need it.

  6. #6

    Re: Bash script for sorting mp3's.

    a) take $artist, make a dir for the artist with the $artist variable if there are more than 2 songs by that artist
    b) move the songs with 2 or more songs by that artist to the dir created from the artists name
    c) move the songs that didn't have another song by the same artist to a serperate dir (eg, misc)

    Its a bit to complicated for me to even attempt. Could someone possibly write a script for me?
    I agree with Ralinx, you should learn how to do it yourself. The part about moving the one-song artists into a misc directory could be kind of tricky, but the rest is easy. I mean, about 5 lines max. Just make a for loop to cycle through the files, use sed to weed out the artists name, then use mkdir to make the dir, then move it in there. I'd write it for you myself but I want you to learn

  7. #7

    Re: Bash script for sorting mp3's.

    Hope your set pattern is 100% and that there are no "-" in any of the artist names or it'll make it a bit more challenging

  8. #8

    Re: Bash script for sorting mp3's.

    What will help you learn is to get some code that works. read it. And watch HOW it works. There are a few sites out there that you can copy some bash scripts from. This is one I contribute to:
    http://www.codeexamples.org/
    Good luck.

Similar Threads

  1. Help with bash script
    By woodson2 in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 12-30-2010, 07:19 PM
  2. SSH and bash script
    By vwgtiturbo in forum Programming
    Replies: 7
    Last Post: 12-25-2008, 05:40 AM
  3. Bash script problem
    By Schotty in forum Programming
    Replies: 1
    Last Post: 04-20-2007, 01:18 AM
  4. Bash script
    By linuxuser in forum Programming
    Replies: 1
    Last Post: 09-01-2005, 03:21 PM
  5. Help with bash script
    By tolstoy in forum Programming
    Replies: 5
    Last Post: 05-21-2002, 11:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •