Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!occrsh!occrsh.ATT.COM!rjd From: rjd@occrsh.ATT.COM Newsgroups: comp.sys.att Subject: Re: Using 'exit' in a Bourne shell scri Message-ID: <144800024@occrsh.ATT.COM> Date: 4 Feb 88 21:00:00 GMT References: <169@mccc.UUCP> Lines: 23 Nf-ID: #R:mccc.UUCP:-16900:occrsh.ATT.COM:144800024:000:789 Nf-From: occrsh.ATT.COM!rjd Feb 4 15:00:00 1988 >>>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... It can be dangerous if root uses a 'kill -? 0'..... On the subject of "stty 0" - It is *supposed* to do a hangup and other things, but in some instances it locks up the terminal driver device (at least on some systems...) Randy