Live data from Hacker News

The Unix `Who` Command

gauthier.uk

1–10 of 43 posts

Re: The Unix `Who` Command

#3
I was confused - is "who mom hates" supposed to do something interesting?

On my Mac it seems any two arguments are allowed as an alias for "am i", so long as the first doesn't start with "-".

Looking it up, https://unix.stackexchange.com/questions/108145/is-who-mom-l... suggests it's a well-known in-joke.

FWIW, on my FreeBSD machine, only "who am i"/"who am I" are allowed.

Re: The Unix `Who` Command

#4
I was hoping to see why who was better than w or similar, instead I was pleasently surprised to find someone taking a really simple unix command, reverse engineering it, and reimplementing it

Re: The Unix `Who` Command

#6

His "who" implementation is 73 lines (21 if you remove blank lines and comments). Compare that to 836 in GNU Coreutils[0]. [0] https://github.com/coreutils/coreutils/blob/master/src/who.c

> Of course, this only mocks the most basic features of the who command and doesn’t handle any option, like the famous `who am i` or `who mom hates`.

it's not quite an apples to apples comparison as his rewrite doesn't handle any options or cleverness, but it's still a massive jump in LOC.

Re: The Unix `Who` Command

#7

His "who" implementation is 73 lines (21 if you remove blank lines and comments). Compare that to 836 in GNU Coreutils[0]. [0] https://github.com/coreutils/coreutils/blob/master/src/who.c

openbsd 'who' is in the 300 range:

http://cvsweb.openbsd.org/src/usr.bin/who/who.c?rev=1.29&con...

this version appears to derive from rewriting unix who in the 4.4BSD era to replace AT&T code (copyright 1989 / no AT&T in header notes as basis for assumption)

Re: The Unix `Who` Command

#8

His "who" implementation is 73 lines (21 if you remove blank lines and comments). Compare that to 836 in GNU Coreutils[0]. [0] https://github.com/coreutils/coreutils/blob/master/src/who.c

> Of course, this only mocks the most basic features of the who command and doesn’t handle any option, like the famous `who am i` or `who mom hates`. it's not quite an apples to apples comparison as his rewrite doesn't handle any options or cleverness, but it's still a massive jump in LOC.

Nor is it anywhere near as portability. Though that's not a big issue these days.

Re: The Unix `Who` Command

#9

His "who" implementation is 73 lines (21 if you remove blank lines and comments). Compare that to 836 in GNU Coreutils[0]. [0] https://github.com/coreutils/coreutils/blob/master/src/who.c

> Of course, this only mocks the most basic features of the who command and doesn’t handle any option, like the famous `who am i` or `who mom hates`. it's not quite an apples to apples comparison as his rewrite doesn't handle any options or cleverness, but it's still a massive jump in LOC.

I know that it isn't a full implementation and my comment wasn't meant as a real comparison.

Re: The Unix `Who` Command

#10
post #7

His "who" implementation is 73 lines (21 if you remove blank lines and comments). Compare that to 836 in GNU Coreutils[0]. [0] https://github.com/coreutils/coreutils/blob/master/src/who.c

openbsd 'who' is in the 300 range: http://cvsweb.openbsd.org/src/usr.bin/who/who.c?rev=1.29&con... this version appears to derive from rewriting unix who in the 4.4BSD era to replace AT&T code (copyright 1989 / no AT&T in header notes as basis for assumption)

Its interesting. FreeBSD's is about the same size, but was again re-written in 2002 to "to add some features required by SUSv3" : https://github.com/freebsd/freebsd/commit/1894db5ac7af64acc7...
Post reply on HN