BASH script to enumerate titles and chapters of a dvd and rip the longest one into avi using mencoder. DVD device can be a path to mounted iso (e.g. /mnt/iso/) or a real device (e.g. /media/cdrom0/).

To rip all titles and chapters, try this.

Read the rest of this entry…

BASH script to enumerate titles and chapters of a dvd and rip each into a separate avi using mencoder. DVD device can be a path to mounted iso (e.g. /mnt/iso/) or a real device (e.g. /media/cdrom0/).

To rip just the longest title, try this.

Read the rest of this entry…

Let’s say you’ve got a string like:

$ string="abc.Cat.def.1.zip.hij.Cut.klm.1.zip.Cat.no.2.zippqrs"

Out of this string, you want to pick out Cat*zip (Cat.def.1.zip and Cat.no.2.zip), “.*” works but is greedy so this grabs too much:

$ echo $string | grep -Eo "Cat.*zip"
Cat.def.1.zip.hij.Cut.klm.1.zip.Cat.no.2.zip

This does what we want:

$ echo $string | grep -Eo "Ca[t][^t]*.zip"
Cat.def.1.zip
Cat.no.2.zip