#!/bin/bash if [ $# -eq 1 ] ; then if expr "$1" : "^.*\.....$" ; then ffmpeg -i "$1" "${1:0:-4}mp3" fi if expr "$1" : "^.*\....$" ; then ffmpeg -i "$1" "${1:0:-3}mp3" fi fi