Close Notebook and Exit

Q: How can I save a notebook, quit the kernel, and close the notebook, using kernel or front-end commands in the notebook, with no keyboard input?

Dick Zacher (zacher_dick@tandem.com) answers: Use the code

[Graphics:inoutbgr2.gif][Graphics:inoutbgr69.gif]

The front end sends the entire expression to the kernel before evaluation; once it is sent to the kernel, there is no more need for the notebook, and the [Graphics:inoutbgr70.gif] is executed.