Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!rutgers!att!mtuxo!rolls!attdso!tim From: tim@attdso.ATT.COM (Tim J Ihde) Newsgroups: comp.unix.wizards Subject: Re: .logout for ksh? Summary: No exit needed in trap 0 Keywords: .logout, KSH, help!!! Message-ID: <599@attdso.ATT.COM> Date: 5 Oct 88 13:41:20 GMT References: <1594@mcgp1.UUCP> <415@motbos.UUCP> <1529@nunki.usc.edu> Reply-To: tim@attdso.UUCP (Tim J Ihde) Organization: AT&T DSO-HQ, Morristown, NJ Lines: 28 In article <1529@nunki.usc.edu> connet@castor.usc.edu (David Connet) writes: >In article <415@motbos.UUCP> artp@motbos.UUCP (Art Parmet) writes: >>trap "/local/bin/logoff" 0 >Ummm, you had better add an exit in the trap, or after executing >/local/bin/logoff, you get your prompt back. >This is what I do: > trap "logout;clear;exit" 0 3 Eh? I've had trap '$HOME/.logout' 0 in my profile through several versions of ksh, and I never see my prompt back. If you trap with a signal number >0, then when the signal is received the trap is executed and the shell resumes (so you would need an exit); but signal number 0 is a special case: If 'n' is 0 then the command 'arg' is executed _on_exit_from_the_shell._ (User's Manual) So the 0 trap is run during the exit, but does not interrupt the exit. -- Tim J Ihde UUCP: att!attdso!tim (201) 898-6687 INTERNET: tim@attdso.att.com "Blimey - this redistribution of wealth is more complicated than I'd thought!" - Dennis Moore and misc. Presidents