Xref: utzoo comp.sys.att:2363 comp.unix.questions:5423 Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!mordor!sri-spam!rutgers!mtune!codas!usfvax2!jc3b21!larry From: larry@jc3b21.UUCP (Lawrence F. Strickland) Newsgroups: comp.sys.att,comp.unix.questions Subject: Re: Using 'exit' in a Bourne shell script Message-ID: <280@jc3b21.UUCP> Date: 2 Feb 88 13:17:27 GMT References: <1062@bakerst.UUCP> Organization: St. Petersburg Jr. College, FL Lines: 21 in article <1062@bakerst.UUCP>, kathy@bakerst.UUCP (Kathy Vincent) says: > > In article <169@mccc.UUCP> pjh@mccc.UUCP (Peter J. Holsberg) writes: >>I would like to have my users logout via a shell script "off" rather >>than with ^d. The script I wrote is very simple, but 'exit' has no >>effect. ... > > trap '$HOME/.logout' 0 As you mentioned, exit will only get you out of the script, not the enwrapped shell. I've always had good luck with: kill -9 0 in a shell script. This is a bit rough (as it kills ALL programs associated with the terminal, including background ones), but it has to be since a normal kill is ignored by the shell. I'm sure there is a better way, too... -- +--------------------------------------+-- St. Petersburg Junior College --+ | Lawrence F. Strickland | P.O. Box 13489 | | ...gatech!codas!usfvax2!jc3b21!larry | St. Petersburg, FL 33733 | +-(or) ...gatech!usfvax2!jc3b21!larry -+-- Phone: +1 813 341 4705 ---------+