Just a thought, instead of going through each and every file type manually, why not plug into each desktop managers own way of handling file association (http://en.wikipedia.org/wiki/File_association)? Using MIME based file association, there should be an easy way to create the "openit" command. The way the 'click on file' functionality is handled is similar.
Mac OS X has something similar (http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/open.1.html). Reading its man page can give more idea on what other features can be implemented (like opening folders in a window, opening with a non default file). -- LUG@IITD - http://lug-iitd.org/Footer
