Hi all, hopefully someone will be able to help with a little shell scripting problem.
Basically, I need to be able to find out the "first part" of a filename, i.e. the bit before the extension. I'm only looking at this for .tar.gz files (so if, say, there was a file called myfile.tar.gz, I'd want to get the result myfile). The first solution that came to mind was
but this doesn't work if there's a dot anywhere else in the name (like my.file.tar.gz). If anyone's got any ideas, they'll be much appreciated.