The /bin/true Command and Copyright

This article originally appeared on John Chambers' page and mirrored here for historical preservation. All credit to John for this article. If you are John Chambers and you don't like that I'm mirroring this, please email me (elw at sdf.org) ;)

Back
Home

The /bin/true Command and Copyright
by John Chambers

One of the fun examples among all the copyright fuss is the extreme example of copyright claims made by AT&T some time in the 1980s. It's the /bin/true program. This is a "dummy" library program whose main function is to make it easy to write infinite loops (while true do ...) in shells scripts. The "true" program does nothing; it merely exits with a zero exit status. This can be done with an empty file that's marked executable, and that's what it was in the earliest unix system libraries. Such an empty file will be interpreted as a shell script that does nothing, and since it does this successfully, the shell exits with a zero exit status. But AT&T's lawyers decided that this was worthy of copyright protection.
The earliest copyrighted version of /bin/true that I've found so far dates from 1984:
| 
| #     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"
	
That's the entire file. I've added the initial "| " so that you can see the exact contents. Note that it only contains blank lines and a comment (the #ident line identifying it as the "true" command). That's right; AT&T claimed copyright on three blank lines. So if you use blank lines in any of your files, you are in blatant violation of AT&T's copyright claim.

Lest you think that this is a fluke that was quickly corrected, here is the /bin/true program from AT&T's Sys/V libraries as of 1990:

| 
| #     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   */
	
Note that there is still nothing in this script except three blank lines and a copyright notice, plus the #ident line that now identifies it as version 1.6.

It might also be noted that, since I am "publishing" the entire contents of an AT&T program I am in blatant violation of AT&T's copyright claim. I've pointed this out publicly on numerous occations, in various technical forums, since the early 1980's. So far I haven't heard a word from any AT&T lawyers. Anyone have any idea why they are ignoring such a violation?

We might also note that linux systems avoid violating this copyright by replacing /bin/true with a compiled binary. This also runs a lot faster than the above shell script, since it avoids firing up a second unrelated program (/bin/sh) to do nothing. This is yet another reason that linux outperforms unix. And they were apparently forced into this efficiency improvement by AT&T's copyright claim. ;-)


Addendum:

AT&T isn't the only company to do such things. Here's the same program on a Solaris system in 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   */
	

Note that there is one less blank line here; it has been replaced by the #! line. But otherwise it is identical. Sun has merely passed on the copyright notice. I wonder if Sun has written permission from AT&T to use blank lines in their code? And I'm a bit disappointed that Sun didn't replace "AT&T" with "Sun Microsystems" throughout. Maybe their lawyers advised not to do this.


Meanwhile, the nice folks at GNU have handled this issue by reimplementing the "true" command in C. This program isn't just smaller and faster than the old shell script, which requires firing up a new shell process to successfully do nothing. They also added some important command-line options:
	--help      display this help and exit
	--version   output version information and exit
	
Presumably these options were added so they could claim that this wasn't just a stolen copy of the AT&T code; the GNU version actually contains code that does something. Those GNU folks do have a sense of humor. Here's the result of the --version option on a handy linux (knoppix) system in 2007. Note that it's up to version 5.94. Note also the claim that there is no warranty, which in this case presumably means that if the program actually does something, you can't sue them. And note that this version does something that's almost unknown in the software business: It includes an attribution giving the programmer's name.
| $ /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 /bin/true (or /usr/bin/true) command is now nearly obsolete, because most extant shells now have a builtin "true" command. But it's still useful occasionally, for various silly reasons, and the attempts to copyright it are still a good source of absurdist humor. It's especially fun to note that GNU has reason to copyright their version. This prevents AT&T, Sun or SCO from taking the GNU code, claiming it as their own, and suing the linux crowd for infringement.
Copyright © John Chambers, 1990, 1993, 2003, 2007, 2009 ;-)