Why is “who mil” allowed to produce no output

historyposixwho

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?

Best Answer

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.

Related Question