Ar an 10u la de mi 9, scriobh Chris Higgins :
> We're talking about the contents of the wtmp/utmp files, as interpreted by
> the command 'who'
>
> If you upgrade your version of who, and the formatting changes slightly,
> you run the risk of breaking your scripts (in strange and wonderful ways).
Anyone going to change who to do that is going to have to be both
brave & a fan of needless incompatibility. Oh, wait, this is linux.
5:11PM ~ > uname
OpenBSD
5:13PM ~ > who -m
kehoea ttyp0 Sep 10 16:39 (my.host.name)
5:13PM ~ >
5:14PM ~ > uname
OSF1
5:14PM ~ > who -m
kehoea pts/8 Sep 10 16:39 (my.host.name)
5:14PM ~ >
$ uname
SunOS
$ who -m
kehoea pts/1 Sep 10 17:16 (my.host.name)
$
$ uname
Linux
$ who -m
pc734!kehoea pts/6 Sep 10 17:14 (my.host.name)
$
> Would it not make more sense to query the files directly so that
> you can be sure that the information is more reliable than grep'ing
> from 'who'
getutent(3) and setutent(3) are less portable than who(1), believe it
or not.
--
`... when the elephant man broke strong men's necks, when he'd had too
many Powers, ...'
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!