Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.unix.questions Subject: Re: Logging the ^d logoff Message-ID: <7266@brl-smoke.ARPA> Date: 16 Feb 88 19:51:57 GMT References: <209@mccc.UUCP> <7255@brl-smoke.ARPA> <213@mccc.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 6 Ok, here's a working version. I chose to evaluate $LOGNAME when the trap is set, to forestall any later forgery, but you can change this if you wish, once you figure out the general principle by studying this example: echo "IN:\t$LOGNAME\t`tty`\t`date`" >> /usr/.logins trap "echo \"OUT:\t$LOGNAME\t\`tty\`\t\`date\`\" >> /usr/.logins" 0 1 15