You must be root to run that command.
for n in `~pjungwir/bin/range 1 32`; do cdda2wav -D /dev/cdrom -t $n track$n.wav; done;
This command assumes you have less than 32 tracks on the CD. As soon as you grab a track, cdda2wav will show you the total number of tracks you need.
Next convert the wav files into cdr files:
for n in `~pjungwir/bin/range 1 32`; do sox track$n.wav track$n.cdr; done;
Finally, burn it to a CD:
cdrecord -v dev=/dev/hdc speed=2 -audio `ls -tr track*.cdr`
cdrecord -v dev=/dev/hdc speed=2 -audio \ $(for n in `~pjungwir/bin/range 1 32`; do echo track$n.cdr; done)
Add the blank=all option if you're using a cdrw disk that already has data.
mkisofs -r -o cd_image source_directory
You can use -R instead of -r for RockRidge extensions with different permissions. -J gives you Joliet filenames in addition to the ISO9660 filenames. -l uses 32-character filenames instead of 8.3 filenames.
Burn the cd like this:
cdrecord -v speed=2 dev=/dev/hdc -data cd_image
Again, use blank=all if you're writing to a used cdrw disk.
dd if=/dev/cdrom of=image.iso