PDA

View Full Version : Truncated 'last' output, please help!


hackeron
01-03-2004, 02:20 PM
Hey,

I am having problems with the 'last' command which
is part of the package found on:
http://www.kernel.org/pub/linux/utils/util-linux/

I have the following problems:
1) It truncates username to 8 characters, potpockey becomes potpocke
2) any truncated output cannot be fixed with awk or cut
(example ps: aux | awk '{ print $11 } fixes truncated output for ps)
3) Doesn't display seconds

Could someone please provide a fix or an alternative, because I highly require
this functionality of being able to get a list of:
Login time , Login duration, IP and Username and require seconds support
(Login times either as timestamp or date with seconds will do, but need
seconds)

I tried searching for parsing /var/wtmp with perl and other related keywords
to wtmp, but cannot find anything that works .

01-04-2004, 06:59 AM
RESOLVED!

Thanks to the great help of 'jake' on irc.freenode.org for writing a short patch, I managed to get issue resolved now. Look at the patch, it includes a patch for the manual pages, then just recompile util-linux and voila, you get a lot more functionality

http://expert.ics.purdue.edu/~bmath...til-linux.patch