15

In the 2016 edition of IEEE Std 1003.1-2008 (a.k.a. The Open Group Base Specifications Issue 7, or just the POSIX standard), the Rationale section of the who utility mentions the following:

It is acceptable for an implementation to produce no output for an invocation of who mil.

Who or what is "mil"? Why is an implementation allowed to produce no output for who mil?

Rhymoid
  • 322
  • 2
  • 10

1 Answers1

1

Reading the man page of "who", it says the first positional argument represents the file which is to be read. Adding the argument "mil" tells "who" to open "./mil" and inspect it for login information...since there (presumably) is no such file, it outputs nothing...as if there were no users logged in. I suppose it could output some useful error messages, but that may be counterproductive. E.g., imagine the case where the system has just started, and no users have yet signed in. In that case, the login file would be empty or non-existent. Thus, the proper output from "who" is "no response" (i.e. no users are signed in) instead of a misleading error message.

Metuchen
  • 46
  • 2
  • It crossed my mind, but I don't think this is the answer per se. First, file arguments are an XSI extension, and I'm not sure if this feature was included in early versions of `who` (I'd have to disassemble [UNIX v1's utilities to see](https://github.com/jserv/unix-v1/tree/master/fs/root/bin). Furthermore, as the other XSI extension `who am i` breaks this pattern, I wouldn't be so quick expect `who mil` to read a file; it might just be a similar easter egg. – Rhymoid Dec 22 '16 at 18:16
  • Who accepted a file argument as early as [V3](http://www.tuhs.org/cgi-bin/utree.pl?file=V3/man/man1/who.1). I think the posix standard just has a typo and they meant to say "who file". – Mark Plotnick Dec 23 '16 at 23:18