#!/bin/csh -f set id=(`cd-discid /dev/cdrom`) set disk=(`cddb-tool query "http://freedb.freedb.org/~cddb/cddb.cgi" user anonymous $id `) cddb-tool read "http://freedb.freedb.org/~cddb/cddb.cgi" username hostname $disk[2] $id[1] > /tmp/rip.$$ grep TITLE /tmp/rip.$$ echo "" set artist="`grep DTITLE /tmp/rip.$$|cut -d= -f2|cut -d/ -f1|tr -d '\r'`" set album="`grep DTITLE /tmp/rip.$$|cut -d= -f2|cut -d/ -f2|tr -d '\r'`" cat < /tmp/rip.script mkdir "$artist - $album" EOF @ count = 0 while ($count < $id[2]) @ count++ set song="`grep TTITLE /tmp/rip.$$ |tail +${count} |head -1|cut -d= -f2-|tr -d '\r'`" cat <> /tmp/rip.script cdparanoia -q $count - | lame -b 192 -q 0 --tt "$song" --ta "$artist" --tl "$album" --tn $count - "$artist - $album/$artist - $song.mp3" EOF end rm -fr /tmp/rip.[0-9]* >& /dev/null chmod 755 /tmp/rip.script cat /tmp/rip.script echo "Now run /tmp/rip.script if it's ok..."