From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7492 invoked from network); 22 Aug 2000 18:24:44 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 Aug 2000 18:24:44 -0000 Received: (qmail 13399 invoked by alias); 22 Aug 2000 18:24:16 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3390 Received: (qmail 13392 invoked from network); 22 Aug 2000 18:24:14 -0000 From: "Bart Schaefer" Message-Id: <1000822182401.ZM7808@candle.brasslantern.com> Date: Tue, 22 Aug 2000 18:24:01 +0000 In-Reply-To: <14754.42242.721509.918727@paullew-ultra.cisco.com> Comments: In reply to Paul Lew "Re: TRAPNAL with TMOUT problem" (Aug 22, 9:06am) References: <14752.50467.89781.100331@paullew-ultra.cisco.com> <000821104808.ZM29840@candle.brasslantern.com> <14754.42242.721509.918727@paullew-ultra.cisco.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Paul Lew Subject: Re: TRAPNAL with TMOUT problem Cc: zsh-users@sunsite.auc.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 22, 9:06am, Paul Lew wrote: } Subject: Re: TRAPNAL with TMOUT problem } } >>>>> "Bart" == Bart Schaefer writes: } } Bart> Probably what's happening is that the terminal is getting } Bart> "accessed" when the background job runs. (My traps use only } Bart> builtins, so no new job group needs to become associated } Bart> with the terminal.) } } This is what I have defined: } } TRAPALRM () { } local howner } howner=$(host_owner) ^^^^^^^^^^^^^ My guess is that this command substitution causes the tty to be accessed, via utils.c:attachtty(), thereby changing the idle time. } if [[ $howner != $LOGNAME && $howner != "" ]] } then } echo "exit non-allocated machines" } exit } fi } } } } host_owner () { } awk '$1 == "'"$HOST"'" {print $4}' $ar/etc/devhost } } } } Here the content of file devhost might change by other programs. } Could you find anything suspicious here? Should I redirect I/O on the } awk command line? Thanks.. Redirecting awk's I/O isn't going to help because $(...) creates a sub- shell that may do its own attachtty() before starting awk. So what you may have to do is avoid using a command substitution. Something like this: TRAPALRM () { local howner host_owner if [[ $howner != $LOGNAME && $howner != "" ]] then echo "exit non-allocated machines" exit fi } host_owner () { setopt localoptions no_ksh_arrays local devhostent while read -A devhostent do if [[ $devhostent[1] == $HOST ]] then # howner in scope of caller! howner=$devhostent[4] return fi done < $ar/etc/devhost } See if that doesn't help. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net