<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1"><tt>print UPDATE "$_\t1"<br>
<br>
<br>
"ps auxww" will give you a process list, from which you can get the
PID, so that you can call "kill -HUP &lt;PID&gt;"<br>
<br>
Hope this helps,<br>
Mathew Robertson<br>
</tt></font><br>
Camillo Pereira wrote:
<blockquote
 cite="mid:b4ecfae80903262244i1629387eve24afccad6141ce6@mail.gmail.com"
 type="cite">Hi,<br>
  <br>
I have the following scenario where I need to extract node name
information based on certain conditions from an application, and write
the data out to a file and HUP the process concerned.&nbsp; I have managed
to get to a certain point however need some advise.<br>
  <br>
Script output:<br>
  <br>
#!/usr/bin/perl<br>
use strict;<br>
use warnings;<br>
  <br>
## Cut down version of regex list<br>
  <br>
my @critical_device_def = (<br>
&nbsp;&nbsp;&nbsp; [AAA &nbsp;&nbsp; =&gt; qr{...apb09}&nbsp;&nbsp; &nbsp;],<br>
&nbsp;&nbsp;&nbsp; [BBB &nbsp;&nbsp; =&gt; qr{...avggd09}&nbsp;&nbsp; &nbsp;],<br>
&nbsp;&nbsp;&nbsp; [CCC =&gt; qr{...uytwop09}&nbsp;&nbsp; &nbsp;],<br>
&nbsp;&nbsp;&nbsp; [DDD =&gt; qr{...loupoi09}&nbsp;&nbsp; ]<br>
  <br>
);&nbsp; <br>
  <br>
my @DEVICE_LIST;<br>
my $file = "rules.txt";<br>
my @tokens;<br>
  <br>
open(UPDATE, "&gt;$file") || die "Can't open new file: $!\n";<br>
  <br>
@DEVICE_LIST=`/opt/OV/bin/ovtopodump | awk '\$3 ~
/^[a-z]+.*\.my\.domain\.com\.au/{print \$3}'| uniq`;<br>
  <br>
foreach (@DEVICE_LIST)<br>
&nbsp; { <br>
&nbsp;&nbsp;&nbsp; for my $t (@critical_device_def)<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp; my ($site, $device, $flag) = @$t;<br>
&nbsp;&nbsp;&nbsp; &nbsp; if ($_ =~ m/\G($device)/gc) <br>
&nbsp;&nbsp;&nbsp; &nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print UPDATE "$_" ;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; next;<br>
&nbsp;&nbsp;&nbsp; &nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp; }<br>
  <br>
=====<br>
  <br>
The problem I am having is that at the print UPDATE line, I need to
append to the data a tab and the number 1.&nbsp; With the current code, the
file output looks like this:<br>
  <br>
  <a moz-do-not-send="true" href="http://cpploupoi09.my.domain.com.au">cpploupoi09.my.domain.com.au</a><br>
  <a moz-do-not-send="true" href="http://cpqavggd09.my.domain.com.au">cpqavggd09.my.domain.com.au</a><br>
  <br>
however, I need the contents to be printed to the file in the format
below where the hostname then a tab and the number one is printed:<br>
  <br>
  <a moz-do-not-send="true" href="http://cpploupoi09.my.domain.com.au">cpploupoi09.my.domain.com.au</a>
&lt;tab_space&gt; 1<br>
  <a moz-do-not-send="true" href="http://cpqavggd09.my.domain.com.au">cpqavggd09.my.domain.com.au</a>
&lt;tab_space&gt; 1<br>
  <br>
What is the best way to do this?<br>
  <br>
Also what is the best way to send a HUP signal to a running Unix
process?<br>
  <br>
Appreciate your help.<br>
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Melbourne-pm mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Melbourne-pm@pm.org">Melbourne-pm@pm.org</a>
<a class="moz-txt-link-freetext" href="http://mail.pm.org/mailman/listinfo/melbourne-pm">http://mail.pm.org/mailman/listinfo/melbourne-pm</a></pre>
</blockquote>
</body>
</html>