[PLUG] Check program running...

someone plug_0 at robinson-west.com
Tue Jan 23 20:38:49 UTC 2007


On Tue, 2007-01-23 at 11:47 -0800, Russell Senior wrote:
> >>>>> "drew" == drew wymore <drew.wymore at gmail.com> writes:
> 
> drew> just use pidof `process name`
> 
> but not with backticks, which do something you don't want done here.
> 
> 

[root at goose plug_0]# ps ax | grep perl
24204 ?        S      0:05 /usr/bin/perl ./setdodoip.pl
31462 pts/1    S+     0:00 grep perl
[root at goose plug_0]# /sbin/pidof setdodoip

[root at goose plug_0]# /sbin/pidof ./setdodoip

[root at goose plug_0]# /sbin/pidof /usr/bin/perl
24204 4773 4772 4771 4770 4769 3625
[root at goose plug_0]# /sbin/pidof /usr/bin/perl setdodoip
24204 4773 4772 4771 4770 4769 3625
[root at goose plug_0]# /sbin/pidof /usr/bin/perl ./setdodoip
24204 4773 4772 4771 4770 4769 3625
[root at goose plug_0]#

Well, I'm having a hard time getting the right one.

The correct answer is 24204 in this case, but I'm having
a hard time getting that using pidof.

Using the pidof command was a good suggestion though.

Michael C. Robinson




More information about the PLUG mailing list