>>> UPID=`ps -C uhci-control -o pid --no-headers`
>>
>> That is almost what I initially thought:
>> UPID=`ps -C uhci-control -o pid=`
>> (if all column heads are empty, no header line is printed)
>
> Haven't checked it, but would
>
> UID=`ps -u root -C uhci-control -o pid=`
>
> work? If -u and -C can not yet be specified together, would it make
> sense to allow it in the a futher version of ps ?
That does not work the way you might want it to work.
As required by standards, you get BOTH root-owned processes
and processes named "uhci-control".
I have indeed thought about adding an option to change the logic.
This is fairly good:
UID=`ps --sort=ruid -C uhci-control -o pid= | head -1`
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/