Re: get PID for a process
From: Ed Morton (mortonAVOIDINGSPAM_at_Lucent.com)
Date: 08/07/03
- Next message: Charles Demas: "Re: the . , what it means"
- Previous message: joe_at_invalid.address: "Re: the . , what it means"
- In reply to: Willem Kossen: "Re: get PID for a process"
- Next in thread: John W. Krahn: "Re: get PID for a process"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 07 Aug 2003 09:22:17 -0500
On 8/7/2003 5:28 AM, Willem Kossen wrote:
> "stephan beal" wrote in message
>
>
>>>I want my startup script to make a pid file for a process that does not
>>
> do
>
>>>so itself. How can i get the pid of the proces i just started?
>>
>>The $! variable holds the PID of the last-run app:
>>
>>stephan@cheyenne:~/> emacs &
>>[1] 20743
>>stephan@cheyenne:~/> echo $!
>>20743
>
>
> I know, but it doesn't seem to work from a shell-script and I'm not using &
> is there another way?
It does work from a shell script, but only for background processes. You could
do a "ps" and pipe it to grep or awk for your command name - post a version of
the script if you want better suggestions.
Ed.
- Next message: Charles Demas: "Re: the . , what it means"
- Previous message: joe_at_invalid.address: "Re: the . , what it means"
- In reply to: Willem Kossen: "Re: get PID for a process"
- Next in thread: John W. Krahn: "Re: get PID for a process"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|