[procps] Re: rhbz#737215 - ps does not resolve some user names

  • From: Jim Warner <james.warner@xxxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Wed, 12 Sep 2012 08:03:27 -0500

On Wed, 2012-09-12 at 05:56 -0400, Jaromir Capik wrote:
> Hello guys.
> 
> I recently found a forgotten bug in my list, in scope of which
> one of the ps features was discussed and we found it's usefulness
> a bit controversial.
> 
> Szymon Miotk reported, that he sometimes gets UIDs instead of usernames
> in the UID column. After some investigation we found, that this is
> a ps feature. UID is displayed if the username is too long to fit
> in the column. This feature was very probably introduced to avoid
> breaking the line format/indentation. But as the UIDs can currently
> have 10 digits, the indentation gets broken anyway.
> I promised I'll discuss that with you.
> Do you find reasonable to modify the code to show just a part
> of the username (followed by star or something) if the username
> doesn't fit? This "auto-magic" apparently leads to cunfusions.
> 
> Please, let me know.

Hi Jaromir,

I think the 8 character limit is more a matter of standards rather than
indentation.  Below is an excerpt from Albert's original FAQ, which is
also included in procps-ng under Documentation.

Maybe the real problem is simply a lack of such mention in the man
document.

Regards,
Jim
 
--------------------------------------------------------------
The UNIX and POSIX standards require that user names and group names be
printed as decimal integers when there is not enough room in the column.
Truncating the names, besides being a violation of the standard, would
lead to confusion between names like MichelleRichards and
MichelleRichardson.  The UNIX and POSIX way to change column width is 
to rename the column:

    ps -o pid,user=CumbersomeUserNames -o comm

The easy way is to directly specify the desired width:

    ps -o pid,user:19,comm







Other related posts: