Sorry, it’s way out of my league, but the command:
ps x |grep -v grep |grep -c "plugin-containe"
returns: 0 or 1, isn’t that enough?
Sorry, it’s way out of my league, but the command:
ps x |grep -v grep |grep -c "plugin-containe"
returns: 0 or 1, isn’t that enough?
On 2015-07-07 20:06, noital wrote:
> returns: 0 or 1, isn’t that enough?
Yes, of course, I know it works. I just want to do it the other way. Or
let’s say that I want to learn about that trick with ‘ps’. 
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” (Minas Tirith))
You mean something like:
ps -C syslogd -o pid=
That’s taken verbatim from the man page, if you want the PIDs of all “plugin-container” processes, it would be:
ps -C plugin-container -o pid=
(you can specify the column header after the ‘=’, in this case it’s empty)
Or to go with the format you posted in a previous post:
ps -C konqueror -o pcpu,user,fname,comm
On 2015-07-08 13:46, wolfi323 wrote:
>
> robin_listas;2718651 Wrote:
>> But I have problems getting both options to work in a single command
>> line.
>>
> You mean something like:
>
> Code:
> --------------------
> ps -C syslogd -o pid=
> --------------------
This one is perfect!
cer@minas-tirith:~> ps -C rsyslogd -o pcpu=
0.0
cer@minas-tirith:~>
Thanks!
Or to go with the format you posted in a previous post:
Code:
ps -C konqueror -o pcpu,user,fname,comm
I was trying:
ps -C plugin-containe -xo pcpu,user,fname,comm
but got a syntax error. It doesn’t like the ‘-x’. However, your
concoction is much better, it produces a single word with the value that
is needed, without any need for parsing the text. It should work nicely.
I’ll have a go at it tonight, I hope.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” (Minas Tirith))
Same here.
Maybe you meant “ps -C plugin-containe x -o pcpu,user,fname,comm”? ![]()
However, your
concoction is much better, it produces a single word with the value that
is needed, without any need for parsing the text.
Actually it produces a line with the value for each process with that name (there might be more than one).
On 2015-07-08 18:46, wolfi323 wrote:
>> but got a syntax error. It doesn’t like the ‘-x’.
> Same here.
> Maybe you meant “ps -C plugin-containe x -o pcpu,user,fname,comm”? 
Mmm?
No… it prints dozens of lines, none pertaining to “plugin-container”.
>> However, your
>> concoction is much better, it produces a single word with the value that
>> is needed, without any need for parsing the text.
> Actually it produces a line with the value for each process with that
> name (there might be more than one).
Ah, lines, true…
Ok, not a big deal, anyway. I can use that, I think. 
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” (Minas Tirith))
Yeah, right.
It prints all user processes.
The x probably overrides the -C. Without it it works as intended.
Except that it probably should be “plugin-container”, not “plugin-containe”. The -C option needs a full match, not just a sub-string.
On 2015-07-08 20:16, wolfi323 wrote:
> Yeah, right.
> It prints all user processes.
> The x probably overrides the -C. Without it it works as intended.
Can be.
> Except that it probably should be “plugin-container”, not
> “plugin-containe”. The -C option needs a full match, not just a
> sub-string.
I still haven’t managed to have a go at it today, but when I tried some
days ago I had to remove the ‘r’ because the size of the field is
limited, apparently, and did not match. I have to re-verify this, though.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” (Minas Tirith))