I am making a script that works with directories that have suffixes defined and separated by ".", for example "folder.teste.git" or "things.var" and would like to take as a variable only the prefix eliminating the last one part (eg the name "folder.test" or "things").
I tried with the cut and the grep but I could not get it backwards. I was unable to delete the last occurrence after the ".".