#!/usr/bin/env bash # Loop through all .wav files in the current directory for file in *.wav; do # Skip if no .wav files exist (prevents literal "*.wav" execution) [ -e "$file" ] || continue # Replace .wav extension with .mp3 output="${file%.wav}.mp3" echo "Converting: $file -> $output" lame -v -b 256 "$file" "$output" done echo "Conversion complete!"