From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Paul Lew <paullew@cisco.com>
Cc: zsh-users@sunsite.auc.dk
Subject: Re: TRAPNAL with TMOUT problem
Date: Tue, 22 Aug 2000 18:24:01 +0000 [thread overview]
Message-ID: <1000822182401.ZM7808@candle.brasslantern.com> (raw)
In-Reply-To: <14754.42242.721509.918727@paullew-ultra.cisco.com>
On Aug 22, 9:06am, Paul Lew wrote:
} Subject: Re: TRAPNAL with TMOUT problem
}
} >>>>> "Bart" == Bart Schaefer <schaefer@candle.brasslantern.com> 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
next prev parent reply other threads:[~2000-08-22 18:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-08-21 5:58 Paul Lew
2000-08-21 17:48 ` Bart Schaefer
[not found] ` <14754.42242.721509.918727@paullew-ultra.cisco.com>
2000-08-22 18:24 ` Bart Schaefer [this message]
[not found] ` <14757.19686.238318.996093@paullew-ultra.cisco.com>
2000-08-24 17:27 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1000822182401.ZM7808@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--cc=paullew@cisco.com \
--cc=zsh-users@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).