Name: Anonymous 2011-10-06 15:10
Okay, I'm comfortable with the basic linux commands such as cp, mv, mkdir, etc., but now I want to do something more challenging and I don't know where to start so I'm turning to /prog/ for help.
I have just under five hundred films in a directory, and I want to point XBMC to this directory and have it catalog the films for me. In order to do this though each film file needs to be in a subdirectory with the same name. So what I want to do is to create a command, or a script, to look at a file such as "Kill Bill Volume 1.avi" and create a directory with the same name, and then move the file into the directory, so that I end up with a directory called "Kill Bill Volume 1" and the avi file inside of that. I'd like the command (or script) to do this for each file in the directory.
Any ideas on how I would automate this? Can I create a command to do it, or do I need to write a script? Any ideas on where to start? I cannot face doing this by hand for all 500 files.
...also as an aside - am I going the right way by using XBMC to set up my media centre? Are there any better alternatives I should look at?
I have just under five hundred films in a directory, and I want to point XBMC to this directory and have it catalog the films for me. In order to do this though each film file needs to be in a subdirectory with the same name. So what I want to do is to create a command, or a script, to look at a file such as "Kill Bill Volume 1.avi" and create a directory with the same name, and then move the file into the directory, so that I end up with a directory called "Kill Bill Volume 1" and the avi file inside of that. I'd like the command (or script) to do this for each file in the directory.
Any ideas on how I would automate this? Can I create a command to do it, or do I need to write a script? Any ideas on where to start? I cannot face doing this by hand for all 500 files.
...also as an aside - am I going the right way by using XBMC to set up my media centre? Are there any better alternatives I should look at?