ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm going to try to find the answer to this on my own, but in the mean time I want to know if somebody has already come up with a way to do this.
I want to write a shell script to rip a season of a TV shows that I have on DVD using Handbrake CLI. Also, I want to run each ripped file through a special CLI-based converter (which I already have) so I can watch them on my DS.
The basic format of the shell script would be something like
Where %F is replaced with the name of the series, %S is replaced with the season number, and %E is replaced with the number of the episode in the season.
I already know how to use handbrake CLI and have ripped one whole season but it was tedious and involved a lot of manual intervention. I would like to have a single command to rip subsequent seasons of this show (and others) but I don't know hardly anything about shell scripting except the very basics (cp, rm, ls, mv, how to pipe output, how to set environment variables, etc.). This script would have to be able to stop and wait for the user to switch DVDs after each one was ripped and then wait for a keypress or something to continue.
If anyone knows of a script like this or can at least point me to someplace where I can learn how to write one that would be great. Thanks!
Hi,
If anyone knows of a script like this or can at least point me to someplace where I can learn how to write one that would be great. Thanks!
Can be done in python within half-hour in a bit simplified form.
Except one thing:
Quote:
Originally Posted by TheMusicGuy
Where %F is replaced with the name of the series,
name of the series will have to be user-provided.
Try to read python tutorial, or take any simple shell script (slackware has bunch of them) and examine it. People often write scripts like that and delete them when they are no longer needed, because such scripts are simple. So I'm not sure if something like this will be available for download somewhere, but someone might write that script for you.
This is going to sound odd, but I wanted to see if/how it could be done using only Bash because using Python feels like cheating. That's the main reason I didn't try it already! ^_^
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152
Rep:
Quote:
Originally Posted by TheMusicGuy
This is going to sound odd, but I wanted to see if/how it could be done using only Bash because using Python feels like cheating. That's the main reason I didn't try it already! ^_^
I hope something gets posted here so I can see how it works an use it in my own bash scripts. I don't know any python.
I knew somebody was going to ask that...well, the truth is I don't really know. I guess part of the reason I wanted to do this was so that I could use this as an opportunity to learn how to use Bash better? I already know Python fairly well, and this sort of thing doesn't really require the job of a high-level language like Python as it is basically (I am assuming) just a few loops, a process fork, and some shell commands.
Anyway, though, I've already started on a Python script, but it seems that it's going to take longer than I thought because I won't get a chance to work on it for it until a few days from now. Possibly. But still, I'd like the learning experience of doing it in Shell, so if anyone has an inkling of where one would begin, I'm still open to suggestions...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.