Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'kill -9 wil close ALL terminals' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
kill -9 wil close ALL terminals
Authored by: a1291762 on Jul 02, '01 06:33:39PM

Fortunately or Unfortunately (depending on how you see it) Mac OS X will only let applications run once. When you kill terminal, you will close ALL open windows. While this may be fine for people that only use one window at a time, it's not an optimum situation.

You can set a preference so that terminal windows automatically close (or close if no error).

If you set the terminal preferences to close when no error and set the last line of your script to "exit 0" then the window should automatically close anyway and you won't force other open terminal windows to close. If you did "exit 1" then the window would stay open (which is great when things don't work as you can see what was on the screen)

eg.

#!/bin/sh

read text
if [ "$text" = "" ]; then
# print an error if not text was entered (eg. Ctrl + D)
exit 1
fi

echo $text

exit 0



[ Reply to This | # ]