A script to quit the Terminal from the Terminal

May 04, '04 11:30:00AM

Contributed by: Anonymous

One thing I hate is when you type exit in a Terminal window it closes the window but leaves Terminal.app still running. I wrote this simple little script to solve that. Name it quit, chmod 755 it, and stick it somewhere in your path. Now when you type quit, the whole Terminal app will close, not just the current window.

for i in `ps acx | grep "Terminal" |
awk ' { print $1 ; } ' ` ; do kill -9 $i ; 
[robg adds: I think an easier method to accomplish the same result would be to just create an alias in your shell startup script: alias quit 'killall Terminal'. I don't think it would take anything else down with it, and no shell scripting required...]

Comments (7)

Mac OS X Hints