Let's say I have a string:
x=file.tar.sh
I know how to remove everything but last n-characters. Like this (removing everything but last 3 characters:
${x: -3}
But this doesn't work for files with different suffix lengths. (len .tar != len .sh)
I would tackle this by removing everything until the last dot. I've tried this:
${x##.}
This removes the longest matching until "." but somehow it just returns the full string without removing anything?