Copyright on the / bin / true command

Original author: John Chambers
  • Transfer
Amid all the hype about copyright, there is one funny example - this is an extreme case of using the copyright that AT&T created around the 1980s. This is a program / bin / true. This is an empty program that is usually used only to write endless loops (while true do ...) in shell scripts. The "true" program does nothing, but only exits with zero code. This behavior is easy to achieve - just create an empty file and make it executable, which was done by the creators of the first Unix systems. An empty file is interpreted as a shell script that does absolutely nothing. And, since he succeeds quite well, the shell returns a zero exit code. But AT&T lawyers decided that this would not prevent copyright protection.

The oldest version of / bin / true with copyright that I found relates to the 1984th:

 #     Copyright (c) 1984 AT&T
 #       All Rights Reserved
 #     THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
 #     The copyright notice above does not evidence any
 #     actual or intended publication of such source code.
 #ident        "@(#)cmd/true.sh        50.1"

And this is the whole file. Notice that there are only three empty lines and a comment (the line with #ident indicates what kind of program it is). Yes, you understood correctly; AT&T has copyright on three blank lines. So if some of your files have empty lines, you are brazenly violating AT&T copyright.

So you don’t think it’s just an accident that you quickly fixed, look at the / bin / true program from Sys / V, which AT&T released in 1989:

 #     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
 #       All Rights Reserved
 #     THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
 #     The copyright notice above does not evidence any
 #     actual or intended publication of such source code.
 #ident  "@(#)true.sh    1.6     93/01/11 SMI"   /* SVr4.0 1.4   */

As you can see, there is still nothing here, except for three blank lines and a copyright message. Ah, another line with #indent tells us that the version of this program is now 1.6.

By the way, since I "publish" a whole AT&T program, I shamelessly violate their copyright. I have repeatedly publicly pointed this out at various technical forums since the 1980s. So far, AT&T lawyers have not contacted me. Does anyone know why they are ignoring such a flagrant violation?

There is no such violation in linux, because they use the compiled version of / bin / true there. By the way, it works much faster than the mentioned shell script, because it does not run an extra program (/ bin / sh) just to ensure that it immediately exits. Here it is, the reason linux is faster than unix. And this improvement inevitably had to be done so as not to violate AT&T copyright ;-)

Addition

AT&T is not the only company that does this. Here is the same program from Solaris, 1993:

 $ cat /usr/bin/true
 #!/usr/bin/sh
 #       Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
 #         All Rights Reserved
 #       THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
 #       The copyright notice above does not evidence any
 #       actual or intended publication of such source code.
 #ident  "@(#)true.sh    1.6     93/01/11 SMI"   /* SVr4.0 1.4   */

Please note that here is one empty line less; it was replaced by "#! / usr / bin / sh". The rest of the programs are identical. Sun just left the same comment. Interestingly, did Sun receive written permission from AT&T to use these blank lines? And it bothers me a bit that Sun didn’t even replace AT&T with Sun Microsystems. Maybe their lawyers decided that this should not be done?

And the guys and GNU circumvented this problem by re-implementing the “true” command on C. This program is not only smaller and faster than the old script, which needs to run a whole new process in order to successfully do nothing. They also added important options:

   --help      display this help and exit
   --version   output version information and exit

Perhaps they added these options so that it could not be said that they simply stole the code from AT&T; because the version from GNU does at least something. Looks like the guys at GNU have a sense of humor. Below I copied the message from “true --version” to knoppix in 2007. Note that this is already version 5.94. It says that there is no guarantee for the program. Apparently, this means that if the program, contrary to its purpose, does something, then you cannot sue the author. And also this version does something quite “unusual”: it tells us the name of its author.

 $ /bin/true --version
 true (GNU coreutils) 5.94
 Copyright (C) 2006 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License .
 There is NO WARRANTY, to the extent permitted by law.
 Written by Jim Meyering.
 $

The command / bin / true (or / usr / bin / true) is practically not used today, since most shells simply replace it with a built-in command. But sometimes it is still needed for various reasons, and attempts to declare copyright on it still serve as a good reason for jokes. It is especially funny that GNU has reasons to specify copyright for their version. Thanks to this, AT&T, Sun or SCO can’t take the GNU code, say that it is their own, and then sue Linux oaks for alleged violation.

Also popular now: