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
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
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
>
> =
>
> #!/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
>
> =