All pastes #125886 Raw Edit

Something

public shellscript v1 · immutable
·published 2006-08-11 00:32 UTC
rendered paste body
#!/bin/bash###### Rips CDDA and encode to FLAC###### Public domain, as of 2006-08-11###CDDA_Paranoia="/usr/bin/cdparanoia"CDROM_device="/dev/cdrom"FLAC_encoder="/usr/bin/flac"### Parses the first argument and do what askedcase "$1" in	check)		### Checks the drive and list audio tracks		${CDDA_Paranoia} \			--verbose \			--force-cdrom-device ${CDROM_device} \			--query		;;	encode)		### Encodes given audio files to FLAC audio format		###		### @todo See if something clean exists to replace de Perl one liner... (without using ${*#help})		${FLAC_encoder} \			--verify \			--best \ 			`echo ${*} | perl -pe "s/^\w+\s+//"`		;;	rip)		### Rips every audio tracks found		${CDDA_Paranoia} \			--force-cdrom-device ${CDROM_device} \			--batch \			--output-wav \			${2}		;;	help|*)		### Prints the list of possible commands		echo		echo "Usage: `basename ${0}` {check|encode <files>|help|rip [tracks]}"		echo		echo "Parameter description:"		echo		echo "  check             Checks the drive and list audio tracks."		echo "  encode <files>    Encodes given audio files to FLAC audio format."		echo "  help              Prints the list of possible commands"		echo "                        (the message you are currently reading)."		echo "  rip [tracks]      Rips a CDDA. If no tracks are specified, it rips every"		echo "                        audio tracks found; tracks specification format is:"		echo "                        [first_track][-<last_track>] (e.g. "3", "7-9", "-5")."		echo		;;esac# End of file