Script Bash Obtenha a última posição de caráter em string

last_dash=${str##*-} #finds the dash (-)
Brian Patterson