Earlier quoted context omitted.
Try this with a GNU true binary: `strace /bin/true 2>&1 |wc -l` ;)
That's the C runtime starting up and finishing. That amount of overhead is incurred by (nearly) any program; in fact, worse overhead is incurred using the Sun method of having an empty file, because you have to run the more complex /bin/sh (or equivalent) instead of just a trivial compiled program. ltrace gives a better view of what the program itself (as opposed to the runtime) is doing.
The /bin/true Command and Copyright
21–30 of 31 posts
Re: The /bin/true Command and Copyright
#22Re: The /bin/true Command and Copyright
#23First, copyright does not protect ideas--it only protects the way an author expressed the idea. The closer the expression is to the minimal way to express the idea, the less likely it is to be copyrightable. In the case of the simple implementations of /bin/true and /bin/false, they are pretty darned close to minimal.
Second, if you have author X who produces a copyrightable work, and author Y who later independently produces a work that happens to be identical to X's work, but Y did not copy elements from X, Y is not infringing X's copyright.
This second case doesn't happen often. If someone were to decide to write a novel about boy wizards, and produced something identical to the first Harry Potter book, no one would believe that they did this without copying from Rowling. However, if the work is small enough, an identical independent work is believable.
In the case of the simple /bin/true and /bin/false, a defense that you didn't copy from AT&T would be believable. Even if you admitted you looked at the AT&T source or had it described to you, it would be believable that you produced your own expression of the idea of "a do nothing shell script" and a "shell script that exits with status 255".
Re: The /bin/true Command and Copyright
#24Did AT&T actually tried to enforce this copyright? Because what I see is auto-generated header that is put to every shell script present on the system. Entertaining nonetheless.
Re: The /bin/true Command and Copyright
#25As many know the #ident tag in 'C' code was used with SCCS (pre-cursor to git/svn/cvs/etc) to create a string in the 'binary' which identified the code. In shell scripts it just sat there.
The change in the ident string where it gets the 'SMI' is when the version was from 'Sun Microsystems Inc' (aka SMI).
The reason Solaris included it was because it was part of the 'merge' between SunOS and System V and Sun had permission to all of the AT&T copyrights with respect to UNIX once they became 'partners' (AT&T invested essentially a billion dollars in Sun).
Re: The /bin/true Command and Copyright
#26Re: The /bin/true Command and Copyright
#27For fun, if you are running OS X 10.7: codesign -d -v /usr/bin/true
Aha, that helps explain the discrepancy of OS X 10.7: $ ls -la /usr/bin/true /usr/bin/false -r-xr-xr-x 1 root wheel 34240 Jul 20 2011 /usr/bin/false -r-xr-xr-x 1 root wheel 34240 Jul 20 2011 /usr/bin/true $ cmp -l /usr/bin/true /usr/bin/false |wc 8194 24582 114716 and CentOS 6: $ ls -la /bin/true /bin/false -rwxr-xr-x. 1 root root 25144 Dec 7 14:51 /bin/false -rwxr-xr-x. 1 root root 25144 Dec 7 14:51 /bin/true $ cmp…
On OS X these binaries are fat binaries:
$ file /usr/bin/true
/usr/bin/true: Mach-O universal binary with 2 architectures
/usr/bin/true (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/true (for architecture i386): Mach-O executable i386Re: The /bin/true Command and Copyright
#28(f recall correctly...)
Re: The /bin/true Command and Copyright
#29Idea for GNU's /bin/true new option: --false, that would make it exiting with 1.
Re: The /bin/true Command and Copyright
#30WRONG!