📜 ⬆️ ⬇️

Copyright to the / bin / true command

Among all the hype about copyright, there is one funny example - this is an extreme case of using copyright, which gave rise to AT & T somewhere in the 1980s. We are talking about the program / bin / true. This is an empty program that is usually used only to write endless loops (while true do ...) in shell scripts. The program "true" does nothing, but only terminates with a zero code. This behavior is easy to achieve - just create an empty file and make it executable, which the creators of the first Unix systems did. An empty file is interpreted as a shell script that doesn’t do anything. And, since it succeeds quite well with it, the shell returns a zero completion code. But AT & T lawyers decided that it would not hurt to protect with copyright.

The oldest version of / bin / true with copyright, which I found, refers to 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" 

And this is the whole file. Note that there are only three blank lines and a comment (the line with #ident indicates what kind of program it is). Yes, you understood correctly; AT & T has a copyright of three blank lines. So, if there are blank lines in some of your files, you brazenly violate AT & T's copyright.
')
So that you do not think that this is just an accident, which was quickly corrected, look at the program / bin / true 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 but three empty 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" the whole AT & T program, I shamelessly violate their copyright. I have repeatedly publicly indicated this in various technical forums since the 1980s. Until now, lawyers from AT & T did not contact me. Does anyone know why they ignore such a blatant violation?

In linux, there is no such violation, because the compiled version of / bin / true is used there. By the way, it works much faster than the mentioned shell script, because it does not run an extra program (/ bin / sh) just for the sake of its completion. Here it is, the reason linux is faster than unix. And this improvement inevitably had to be made in order not to violate the 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 */ 

Notice here there is one empty line; it was replaced with "#! / usr / bin / sh". The rest of the program is identical. Sun just left the same comment. Interestingly, did Sun get written permission from AT & T to use these blank lines? And I’m also a little confused that Sun didn’t even replace AT & T with Sun Microsystems. Maybe their lawyers decided they shouldn't do this?

And the guys and GNU avoided this problem by re-implementing the “true” command in 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 

They may have added these options so that it cannot be said that they simply stole the code from AT & T; because the GNU version does at least something. It looks like the GNU guys have a sense of humor. Below, I copied a message from “true --version” to knoppix in 2007. Note that this is version 5.94 already. It says that the program does not provide any guarantee. Apparently, this means that if the program, contrary to its purpose, does something, then you cannot sue the author. And this version also 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 / bin / true (or / usr / bin / true) command 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 amusing that GNU has reasons to specify a copyright for their version. Thanks to this, AT & T, Sun or SCO cannot take the GNU code, say that it is their own, and then sue the Linuxoids for alleged violation.

Source: https://habr.com/ru/post/144058/


All Articles