From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,47b409fbd499d670 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2004-02-27 09:25:44 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!elnk-nf2-pas!newsfeed.earthlink.net!newshub.sdsu.edu!headwall.stanford.edu!newsfeed.stanford.edu!news-proxy.abbnm.com!newsboy.eng.abbnm.com!not-for-mail From: peter@abbnm.com (Peter da Silva) Newsgroups: comp.unix.tru64 Subject: Re: Last command output format Date: Fri, 27 Feb 2004 17:13:25 +0000 (UTC) Organization: ABB Network Management Division Message-ID: References: <9bc9c9cd.0402260631.3ca837fa@posting.google.com> NNTP-Posting-Host: grendel.eng.abbnm.com X-Trace: jeeves.eng.abbnm.com 1077902005 59605 198.178.0.150 (27 Feb 2004 17:13:25 GMT) X-Complaints-To: usenet@jeeves.eng.abbnm.com NNTP-Posting-Date: Fri, 27 Feb 2004 17:13:25 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Originator: peter@abbnm.com (Peter da Silva) Xref: archiver1.google.com comp.unix.tru64:11244 In article <9bc9c9cd.0402260631.3ca837fa@posting.google.com>, Claude wrote: > I would like to know if it is possible to reformat the output > generated by the last command? The "last" command dumps out records from the file "/var/adm/wtmp". These records are in "utmp" format. % man utmp [...] The utmp file records information about who is currently using the system. The file is a sequence of utmp entries, as defined in struct utmp in the utmp.h file. [...] % cat /usr/include/utmp.h [...] struct utmp { char ut_user[32]; /* User login name */ char ut_id[14]; /* /etc/inittab id- IDENT_LEN in init */ char ut_line[32]; /* device name (console, lnxx) */ short ut_type; /* type of entry */ [...] time_t ut_time; /* time entry was made */ char ut_host[64]; /* host name same as MAXHOSTNAMELEN */ }; > The host field is truncated to 16 char where in fact it is a 256 char > field. My host names are longer than 16 characters. 64 char, actually. > Is there another command I can use (perl script maybe) ? That should be enough to get you started. -- I've seen things you people can't imagine. Chimneysweeps on fire over the roofs of London. I've watched kite-strings glitter in the sun at Hyde Park Gate. All these things will be lost in time, like chalk-paintings in the rain. `-_-' Time for your nap. | Peter da Silva | Har du kramat din varg, idag? 'U`