Subject: Re: last(1) vs. utmpx: print new fields (patch)
To: Hubert Feyrer <hubert@feyrer.de>
From: Simon Burge <simonb@NetBSD.org>
List: tech-userlevel
Date: 09/19/2006 14:33:37
Hubert Feyrer wrote:

> 
> Apparently there isn't a tool in NetBSD that can read/display the new 
> utmpx fields. I've made the patch below to change this. Printing the PID 
> is even mentioned in SUSv3. Only the output of -u is changed:
> 
> Before:
>  	miyu% who -Hu
>  	USER     LINE     WHEN         IDLE     FROM
>  	feyrer   ttyE0    Sep 18 22:32  old
>  	[ ... ]
> 
> After:
>  	miyu% ./obj.i386/who -Hu
>  	USER     LINE     WHEN         IDLE        PID  COMMENT
>  	feyrer   ttyE0    Sep 18 22:32  old        142  term=0 exit=0 sess=0 type=USER_PROCESS
>  	[ ... ]
> 
> I couldn't find a lot of documentation on the utmpx fields, so if there's 
> something that can be improved let me know. Else I'd like to commit this.

Personally, I think that's a little verbose for "-u" output, especially
once host names are added.  How about printing the extra info with say
"-v" (currently unused)?

Note also that SUSv3 says "-u" is for idle time, not idle time plus
extra info.

Cheers,
Simon.