how to have gawk receive user signals?
- From: Grant <g_r_a_n_t_@xxxxxxxxxxxxxxxxx>
- Date: Thu, 17 Dec 2009 08:07:42 +1100
Hi there,
Is there a way to have gawk respond to a user signal? I'd like
to tell a gawk script to restart after logrotate does its thing
and pulls a logfile out from under a log pretty-printer script.
The gawk script is evoked by:
# tail -f /var/log/messages | sf4sf -f /etc/sf4sf.conf
And, in the main loop, there's:
....
########################### start main program ##############################
!initialised { initialise(); ++initialised }
# read database files
....
So all I need to restart script is set 'initialised' to zero in
response to a user signal, perhaps -HUP?
My reading of the gawk info doesn't tell much about what signal
handling is available to the running script.
I'm using gawk-3.1.7 on Slackware-11.
[0] http://bugsplatter.id.au/firewall/sf4sf.txt for the curious ;)
Grant.
--
http://bugsplatter.id.au
.
- Follow-Ups:
- Re: how to have gawk receive user signals?
- From: Aharon Robbins
- Re: how to have gawk receive user signals?
- Prev by Date: TV CODES
- Next by Date: Detecting X from AWK
- Previous by thread: TV CODES
- Next by thread: Re: how to have gawk receive user signals?
- Index(es):
Relevant Pages
|