Using 'exit' in a Bourne shell scri
rjd at occrsh.ATT.COM
rjd at occrsh.ATT.COM
Fri Feb 5 07:00:00 AEST 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
More information about the Comp.sys.att
mailing list