I have a variable myVar in bash containing a long string that looks like this:
-rw-rw-rw- root/root 16 2018-02-12 10:03 foo_tar/baz1234_
I want to delete everything in myVar before the last slash (including the last slash), so that myVar ends up storing only baz1234_. How can I remove everything and store the result in a variable?
I have encountered solutions dealing with sed, but those tackle file handling, hence my question.