#!/bin/sh # cdda2flac.sh TARGET_FOLDER # # Script to rip the inserted audio compact disc (CD) to a folder of # FLAC-compressed music files with original quality. # # Provide the wanted target folder as command line argument. It will be created # during execution. folder="${1}" folder="$(realpath "${folder}")" echo "Saving to ${folder}" mkdir "${folder}" return_path="$(pwd)" cd "${folder}" cdparanoia -B find . -type f -iname '*.wav' -exec flac --delete-input-file {} \; cd "${return_path}" echo "\nDone! Files are saved to '${folder}'."