Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Help Needed..... 1

Status
Not open for further replies.

banatello

Technical User
May 18, 2009
4
US
I have been working on this short script to convert movies from vob files to xvid. I would like it to read the file VOB.lst for the list of movies to convert, then just do it. I keep getting error's and I'm not sure how to correct it. Any help would be great.

Script...
---------

#!/bin/bash
for INPUT_MOVIE in 'cat VOB.lst' do mencoder $INPUT_MOVIE -o $INPUT_MOVIE.avi -ovc xvid -oac mp3lame -lameopts cbr:br=224:vol=10 -xvidencopts bitrate=1800;done

The Error's
-----------

./Movie: line 2: syntax error near unexpected token `done'
./Movie: line 2: `for INPUT_MOVIE in 'cat VOB.lst' do 'mencoder $INPUT_MOVIE -o $INPUT_MOVIE.avi -ovc xvid -oac mp3lame -lameopts cbr:br=224:vol=10 -xvidencopts bitrate=1800';done'
 
You need a semi-colon or line feed before the "do".

Also makre sure the quotes around 'cat VOB.lst' are back-quotes, i.e.

Code:
`cat VOB.lst`

Or you could use one of these better syntax to avoid ambiguity:

Code:
$(cat VOB.lst)
$(< VOB.lst)

Annihilannic.
 
Thank you so much, it worked perfect. Can you recommend a good book or web site to teach scriptting better ?
 
Incidentally, if you have other questions like this you should post in the "Unix Scripting" forum. This forum is for awk scripts only.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top