#!/bin/bash OUTFIL="" if ! [ -f "${1}" ] then echo "File ${1} not found" exit 1 fi NAME=$( basename "${1}" .ape ) if [ "${NAME}.ape" != "${1}" ] then NAME=$( basename "${1}" .flac ) if [ "${NAME}.flac" != "${1}" ] then NAME=$( basename "${1}" .mp3 ) if [ "${NAME}.mp3" != "${1}" ] then echo "File ${1} is not Ape, Flac or Mp3" echo "Exeting" exit 1 fi fi fi OUTFIL="${NAME}.hsr.wav" if [ -f "${OUTFIL}" ] then echo "File ${OUTFIL} exists" exit 1 fi echo "Converting ${1} to Wav file ${OUTFIL}" ffmpeg -i "${1}" "${OUTFIL}"