Is there any convenient way to strip an arbitrary extension from a file name, something à la bash ${i%%.*}
? Do I stick to my friend sed
?
I want to delete this, but it's the accepted answer so I can't. This answer is very out of date. Don't use it.
$ set filename foo.bar.baz
$ set rootname (echo $filename | sed 's/\.[^.]*$//')
$ echo $rootname
foo.bar