Is there a way to close a Terminal window from within a shell script? I have a .command file that should just get out of the way once it's done.
(converted to an answer from my comment as suggested)
exit 0 will cleanly terminate the script, but whether Terminal window stays open is user-configurable in Terminal's preferences. The default is to alway stay open, but I prefer the setting "Close if shell exited cleanly". It can be changed in Settings -> Shell -> When the shell exists. With that setting the script will close the window automatically if the exit result is 0 (which is the default if nothing went wrong).