Given a string "this-is-a-test" I want to get the last part after the hyphen "test". What is the cleanest way of doing this in bash? Note, the string could have more or less hyphens than the example.
EDIT: As a user suggested this has already been answered elsewhere and I managed to use the following to solve it:
${my_variable##*-}