#!/bin/bash for file in *.mp3; do OUTPUT=${file%.mp3} echo $OUTPUT ffmpeg -i "$file" "$OUTPUT.ogg" done printf "\nDelete original files? (y / n) " read answer [[ $answer == "y" ]] && rm -f *.mp3