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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cdrecord in script error 1

Status
Not open for further replies.

pavNell

Technical User
Sep 27, 2002
178
US
On a command line I can successfully burn an image to a blank dvd like so...

cdrecord -v -sao tsize=1083354s dev=/dev/dvdrecorder speed=4 driveropts=burnfree myfile.iso
Hooray, it works!!

But in a script the cdrecord command returns...
Bad option: /dev/dvdrecorder

Even tried the option dev=/dev/hdd but it still returns the same error.

Got any suggestions why?
Thanks for any help.
 
Perhaps posting the relevant part of the script will help us to help you ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
My apologies. In my script I have a function like so...

burntodvd () {
mkisofs -r -J -o myfile.iso /billy/temp/*.mpg
sector_size=`mkisofs --print-size myfile.iso`
cdrecord -v -sao tsize=$sector_sizes dev=/dev/dvdrecorder speed=4 driveropts=burnfree myfile.iso
}

the option "dev=/dev/dvdrecorder" in the cdrecord command fails. But works just fine if done manually on the command line.

Using Suse 9.1
Thanks.
 
The problem is probably with the grabbing of sector_size.
Have you tried to add set -x as first instruction in your function to see what is executed ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Mr. PH, you are the man!! Found my error...

Bad syntax when using the value of a variable as a parameter to a command in a script.

Output using set -x...
=============================
+ cdrecord -v -sao tsize= dev=/dev/dvdrecorder speed=4 driveropts=burnfree myfile.iso
cdrecord: Bad Option: dev=/dev/dvdrecorder.
=============================

The tsize parameter was trying to use "/dev/dvdrecorder" as its option.

I modified my function and make an adjustment to the cdrecord command...

burntodvd () {
mkisofs -r -J -o myfile.iso /root/temp/*.mpg
sector_size=`mkisofs --print-size myfile.iso`
cdrecord -v -sao tsize=`echo $sector_size`s dev=/dev/dvdrecorder speed=4 driveropts=burnfree myfile.iso
}

You being #1 on the MVP's list probably knew that already didn't you! But you steered me in the right direction without directly giving me the answer. That's the better way to answer questions. Thanks. And have a star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top