Sometime Today, Mike_Bradz assembled some asciibets to say:
once i exit from the shell script if i type exit again i get logged out, but i want to end the session once the shell script finishes executing.
Ok, from your earlier thread, I think I know what you want. Fall back to VSNL's shell access. They had a menu, and when one selected exit, it would disconnect. You want a similar program that will run on login, and automatically logout when done. The solution is easier than you think, and does not require any restricted shell, or anything else.
Just set the user's shell as the program that has to be executed.
For example, I have a login called survey, that runs a program called survey when someone logs in, and quits immediately afterward.
In /etc/passwd, I just set the shell to /home/survey/bin/survey. The home directory can be anything depending on what your program requires.
Philip