Re: Getting a program pid

2007-06-14 Thread Paul Lalli
On Jun 13, 7:32 pm, [EMAIL PROTECTED] wrote: > On Jun 13, 4:10 pm, [EMAIL PROTECTED] (Owen) wrote: > > > I thought there may have been a perl command like "getpid (program)" > > but it doesn't seem so. > > Yeah, sometimes when we make up commands they don't work. > > Try the special variable $$ (pe

Re: Getting a program pid

2007-06-14 Thread usenet
On Jun 13, 4:10 pm, [EMAIL PROTECTED] (Owen) wrote: > I thought there may have been a perl command like "getpid (program)" > but it doesn't seem so. Yeah, sometimes when we make up commands they don't work. Try the special variable $$ (perldoc perlvar) -- The best way to get a good answer is to

Re: Getting a program pid

2007-06-13 Thread Paul Lalli
On Jun 13, 7:10 pm, [EMAIL PROTECTED] (Owen) wrote: > I thought there may have been a perl command like "getpid (program)" but it > doesn't seem so. > > The program below is the basis of what I want to do, but my question, Is > there a better way of getting the pid? > > TIA > > Owen > > =

Re: Getting a program pid

2007-06-13 Thread oryann9
> > #!/usr/bin/perl -w > > use strict; > > my $program = "vi"; > my $status = `/bin/ps cat | /bin/grep $program`; > > if ( length($status) > 0 ) { > print "$status"; #extract > pid from here > } > else { print "$program not running\n" }# start > program > > =