in reply to Re: Parent process name
in thread Parent process name
It works with one little change:
See the blank space? Depending on it presence, I have to take the forth or the fifth elemnt of the last split. It works changing this line:$ ps -p xxxx PID TTY TIME CMD 29580 pts/4 00:00:00 bash $ ps -p yyyy PID TTY TIME CMD 9556 pts/49 0:00 bash
With this:my $parent = (grep {/^\s*\d+/} (`ps -p $parent_id`))[0];
Now I have at least one blank and have allways to take fifth element. Thanks again for the code.my $parent = " ".(grep {/^\s*\d+/} (`ps -p $parent_id`))[0];
And the worst thing, I've just been told to make it run on Window$ 8( Is there anyway to get rid of the ps calls?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Parent process name
by gsiems (Deacon) on May 28, 2004 at 16:55 UTC | |
Re: Re: Re: Parent process name
by meetraz (Hermit) on May 28, 2004 at 19:06 UTC | |
Re^3: Parent process name
by Anonymous Monk on Jun 03, 2013 at 15:12 UTC |