If we want to separate filename from extension in bash this is a neat and useful trick:
filename=$(basename -- "$fullfile")
extension="${filename##*.}"
filename="${filename%.*}"