cdrdao utility script

friends, i love ya...

i wrote a script to automate using cdrdao to burn an audio cd from mp3 files, using the great tutorial at Linux MP3 CD Burning mini-HOWTO (check out the site, i believe that it's very well-written). i messed around with it and got to a place where i felt comfortable with cdrdao and cdrecord (i also wrote a similar script using cdrecord), and wrote the script based on what was effective using a command line. however, i'm finding that the command line argument isn't working in my script. check out my script:::::

############################

#! /bin/bash
# THIS IS MY CD BURNER. STARTED 4.17.2004...
# -SPENCER

echo "Copying files to temp directory!!!!!!!!!!??????!!!!?!?!!!???"

for i in *.mp3; do cp "$i" /home/snwright/Desktop/temp/`echo $i | tr ' ' '_'`; done

cd /home/snwright/Desktop/temp

echo Now\ working\ in\ `pwd`

echo "Beginning mp3>>wav decoding!!!!??????!!!!"

for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done

echo "Now deleting mp3 files!!!!?????!!!!?!???"

rm -f *.mp3

#echo "Now beginning normalize!!!!!!!!!!!!?!?!???????!!!!!"

#normalize -m *.wav

echo "Now writing TOC!!!!!!!!????!!!!!!!!!!!!!!??"

tocmaker *.wav

echo "Check out what we're workin with!!!!????????????"

ls cd*

echo "Writing!!!!!!!!!!"

cdrdao write --device 0,0,0 --driver generic-mmc cd.toc

########################

the last command there is the significant one. when i run the script, i get the following printout from cdrdao:

Cdrdao version 1.1.8 - (C) Andreas Mueller <andreas@daneb.de>
SCSI interface library - (C) Joerg Schilling
Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html\#dt for current driver tables.

ERROR: Cannot open SCSI device '/dev/cdrecorder':
Supported SCSI transports for this platform:

Transport name: sg
Transport descr.: Generic transport independent SCSI
Transp. layer ind.:
Target specifier: bus,target,lun
Target example: 1,2,0
SCSI Bus scanning: supported
Open via UNIX device: not supported

Transport name: pg
Transport descr.: SCSI transport for ATAPI over Parallel Port
Transp. layer ind.:
Target specifier: bus,target,lun
Target example: 1,2,0
SCSI Bus scanning: supported
Open via UNIX device: not supported

Transport name: ATA
Transport descr.: ATA Packet specific SCSI transport
Transp. layer ind.: ATAPI:
Target specifier: bus,target,lun
Target example: ATAPI:1,2,0
SCSI Bus scanning: supported
Open via UNIX device: not supported

Transport name: ATA
Transport descr.: ATA Packet specific SCSI transport using sg interface
Transp. layer ind.: ATA:
Target specifier: bus,target,lun
Target example: 1,2,0
SCSI Bus scanning: supported
Open via UNIX device: not supported
ERROR: Please use option '--device [path:]bus,id,lun', e.g. --device 0,6,0 or --device ATAPI:0,0,0
ERROR: Cannot setup device /dev/cdrecorder.

however, when the same command is entered from the command line (using bash, still) i get the desired result:

[root@localhost temp]# !cdrdao
cdrdao write --device 0,0,0 --driver generic-mmc-raw cd.toc
Cdrdao version 1.1.8 - (C) Andreas Mueller <andreas@daneb.de>
SCSI interface library - (C) Joerg Schilling
Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html\#dt for current driver tables.

Using libscg version 'schily-0.8'

0,0,0: 24X10X40 CD-RW Rev: 2.00
Using driver: Generic SCSI-3/MMC (raw writing) - Version 2.0 (options 0x0000)

Starting write at speed 24...
Pausing 10 seconds - hit CTRL-C to abort.
Process can be aborted with QUIT signal (usually CTRL-\).
Enabling JustLink.
Enabling JustSpeed.
Enabling JustLink.
Enabling JustSpeed.
Using 96 byte raw P-W sub-channel data mode.
Executing power calibration...
Power calibration successful.
Writing lead-in and gap...
Writing track 01 (mode AUDIO/AUDIO )...
Wrote 1 of 732 MB (Buffers 100% 97%).

etc. why is this? i'm using the same shell, and i'm using the same command. both are executed as root... what gives?

thanks kids,
spencer

i have never made a cd from linux but my guess would be device permissions.

ha. answered my own question. i checked out the printout for `which mydaoburner`, and it pointed to /home/snwright/bin/mydaoburner, which i thought i had made into a link to the file which i had been troubleshooting on - the one i posted above. it wasn't, and i fixed it.
if anyone needs a command-line script that'll decode mp3s to wave and then burn them in disc-at-once, the script i wrote might serve as a guideline.
good luck, all.
spencer