Problem with variable in system command

2002-10-10 Thread Anthony . Kernan
I've written a script to search for all *.pid files in a dir, then do a cat on the file. The script will then use this variable to kill the process. The problem I'm having is that the varibale is not being read correctly. I run the script and the kill process tries to run without the variable.

Re: Problem with variable in system command

2002-10-10 Thread Dharmender Rai
$mypid contains the status of the process not its pid. --- [EMAIL PROTECTED] wrote: > I've written a script to search for all *.pid files > in a dir, then do > a cat on the file. The script will then use this > variable to kill the > process. The problem I'm having is that the > varibale is no

RE: Problem with variable in system command

2002-10-10 Thread Anthony . Kernan
and (substr $entry, 0, -4))); #This will only work with *.pid } > -Original Message- > From: Kernan, Anthony (GOT) > Sent: Thursday, October 10, 2002 7:40 AM > To: '[EMAIL PROTECTED]' > Subject: Problem with variable in system command > > I'

RE: Problem with variable in system command

2002-10-10 Thread Anthony . Kernan
; push @dirstruct, $entry if (($entry ne '') && (( m/$ext$/) and (substr $entry, 0, -4))); #This will only work with *.pid } -Original Message- From: Dharmender Rai [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 8:06 AM To: [EMAIL PROTECTED]; [EMAIL PROT

RE: Problem with variable in system command

2002-10-10 Thread Dharmender Rai
gt; push @dirstruct, $entry if (($entry ne '') && (( > m/$ext$/) and (substr > $entry, 0, -4))); #This will only work with *.pid > } > > > > -Original Message- > From: Dharmender Rai > [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October

RE: Problem with variable in system command

2002-10-10 Thread Anthony . Kernan
al Message- From: Dharmender Rai [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 8:40 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Problem with variable in system command Anthony, system() return the exit status. Type "perldoc -f system" .

RE: Problem with variable in system command

2002-10-10 Thread Paul Johnson
$mypid or die "Can't signal $mypid"; where $sig is whatever signal you want to send. perldoc -f kill > > -Original Message- > From: Dharmender Rai [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 10, 2002 8:40 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED

RE: Problem with variable in system command

2002-10-10 Thread Anthony . Kernan
[EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Problem with variable in system command > Thanks for your replies. I understand that system() returns an exit > code when it is done. My problem is that the command to be run by > system() is not getting the variable

RE: Problem with variable in system command

2002-10-10 Thread Nikola Janceski
D] > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: Problem with variable in system command > > > Thanks, it's working now. I couldn't get the perl kill to > work, it kept > dieing. I used system("

Re: Problem with variable in system command

2002-10-10 Thread John W. Krahn
Anthony Kernan wrote: > > Here is the complete script... > > #!/usr/bin/perl -w > use strict; > use File::Find; > my $dir = '/usr/local/etc/mrtg'; > my $ext = '.pid'; > my (@dirstruct); > my $mypid; > > find(\&wanted,$dir); > > foreach my $afile (@dirstruct) { > $mypid = system("cat $afile