Re: get PID for a process
From: Willem Kossen (wjk100_at_iname.com)
Date: 08/08/03
- Next message: usenet-20030808_at_happyjack.org: "Re: Variable expansion and eval"
- Previous message: Barry Margolin: "Re: Variable expansion and eval"
- In reply to: John W. Krahn: "Re: get PID for a process"
- Next in thread: Michael Wang: "Re: get PID for a process"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 08 Aug 2003 21:26:47 GMT
> > open pidFile, "/var/run/bla.pid"
> > print pidFile, "$$\n"
> > close pidFile
> > there's my pidfile and it works
>
> Well that example won't work because 1) you are opening the file for
> reading not writing and 2) the statements have to be separated with
> semicolons. A more correct example would be:
>
> ( my $prog = $0 ) =~ s!.*/!!s;
> open pidFile, ">/var/run/$prog.pid"
> or die "Cannot open /var/run/$prog.pid: $!";
> print pidFile, "$$\n";
> close pidFile;
>
Your so right, i retyped it in the email in stead of copying from the
script.
Thanks anyway
Willem
- Next message: usenet-20030808_at_happyjack.org: "Re: Variable expansion and eval"
- Previous message: Barry Margolin: "Re: Variable expansion and eval"
- In reply to: John W. Krahn: "Re: get PID for a process"
- Next in thread: Michael Wang: "Re: get PID for a process"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|