${foo%%t*is}
NOTE
While the # and % identifiers may not seem obvious, they have a convenient mnemonic... y the "small is beautiful" spirit of Unix -- they may push the envelope towards the "too simple to be w... ut portability to other shells and systems -- you may want to stick with dirname, basename, and sed
Th... hell scripts to run faster with less overhead and may be easier than some of the more complex sorts of