$ function remove_longest_matching_prefix () { echo "${1##$2}"; } $ remove_longest_matching_prefix "$i" '*/' track1.mp3