From mboxrd@z Thu Jan 1 00:00:00 1970 From: cym224@gmail.com (Nemo) Date: Tue, 28 Nov 2017 11:21:21 -0500 Subject: [TUHS] /bin/true (was basic tools / Universal Unix) In-Reply-To: <009a01d348e9$e3dce200$ab96a600$@ronnatalie.com> References: <009a01d348e9$e3dce200$ab96a600$@ronnatalie.com> Message-ID: On 19 October 2017 at 10:52, Ron Natalie wrote: > My favorite reduction to absurdity was /bin/true. Someone decided we > needed shell commands for true and false. Easy enough to add a script that > said "exit 0" or exit 1" as its only line. > Then someone realized that the "exit 0" in /bin true was superfluous, the > default return was 0. /bin/true turned into an empty, yet executable, file. > > Then the lawyers got involved. We got a version of a packaged UNIX (I > think it was Interactive Systems). Every shell script got twelve lines of > copyright/license boilerplate. Including /bin true. > The file had nothing but useless comment in it. A late comment: I seem to recall this boilerplate in earlier Solaris but Solaris 10 has an executable. So I looked at the OpenSolaris source out of curiosity and found this. [CDDL stuff here] /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" #include /* * Exit with a zero value as quickly as possible. */ int main(void) { _exit(0); /*NOTREACHED*/ return (0); } N.