Can i get object name?

I want to do everything in one shell script for all objects,but i need distinguish each object, so i need get object name,then pass the name to shell script, how can i do it?