In a previous version of textmate the following code for a template worked to create a TM_PACKAGE variable

TM_PACKAGE=`sed <<<$TM_NEW_FILE_DIRECTORY -n 's#.*classes/\(.*\)#\1#p'|tr / .` \

basically it takes the new file directory like this

 /Users/ketan/Documents/client/project/development/classes/client/project
And It turns the "/" to "." and removes everything before the classes so the end result would be
client.project

Any ideas on how to do this ? I am not very good with sed.

Ketan