Live data from Hacker News

The /bin/true Command and Copyright

trillian.mit.edu

11–20 of 31 posts

Re: The /bin/true Command and Copyright

#11
post #7
post #3

Earlier quoted context omitted.

Yes your are surely right. But what about GNU guys' bint/true implementations copyright message? :)

The GNU /bin/true is almost certainly complex enough to qualify for copyright.

This is GNU's Appropriate Legal Notices as required by section 5d of the GPLv3:

  An interactive user interface displays "Appropriate Legal Notices"
  to the extent that it includes a convenient and prominently visible
  feature that (1) displays an appropriate copyright notice, and (2)
  tells the user that there is no warranty for the work (except to the
  extent that warranties are provided), that licensees may convey the
  work under this License, and how to view a copy of this License.  If
  the interface presents a list of user commands or options, such as a
  menu, a prominent item in the list meets this criterion.

Re: The /bin/true Command and Copyright

#13
Alas, this is almost off-topic but I'll mention it anyway. This is part of the "Reporting Bugs" section of the GNU /bin/false command:

    REPORTING BUGS
    Report false bugs to bug-coreutils@gnu.org
I love commands with pesky names.

Re: The /bin/true Command and Copyright

#15
For comparison, here is /usr/bin/false from my Solaris box:

  $ cat /usr/bin/false 
  #!/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  "@(#)false.sh   1.6     93/01/11 SMI"   /* SVr4.0 1.3   */
  exit 255
You'll notice the slight difference with `true`.

Re: The /bin/true Command and Copyright

#16
post #3

Earlier quoted context omitted.

Yes your are surely right. But what about GNU guys' bint/true implementations copyright message? :)

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.

Re: The /bin/true Command and Copyright

#17
post #6

Reminds me of Oracle licensing the Java Hello World: http://docs.oracle.com/javase/tutorial/getStarted/applicatio...

# (c) 2012 me # # The following comment is tried to be copyrighted # by me. Do not misue! # awesome

# Can I use derived works?

Yeah, super awesome!!

Re: The /bin/true Command and Copyright

#19

For 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 -l /bin/true /bin/false |wc
        355    1065    4970
The signature size explains (part of) the larger delta on OS X, but left me wondering, so:

    ~/coreutils/src]$ ls -alrth true.c false.c
    -rw-r--r--  1 dvd  staff   2.2K Jan 30 09:31 true.c
    -rw-r--r--  1 dvd  staff    51B Jan 30 09:31 false.c
Curious!

    ~/coreutils/src]$ cat false.c
    #define EXIT_STATUS EXIT_FAILURE
    #include "true.c"
And figuring out why that still results in such a large binary delta is over my head.

Re: The /bin/true Command and Copyright

#20
post #7
post #3

Earlier quoted context omitted.

Yes your are surely right. But what about GNU guys' bint/true implementations copyright message? :)

The GNU /bin/true is almost certainly complex enough to qualify for copyright.

Indeed: http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/true...

That's pretty clearly a non-trivial source file. Obviously a pointless one, but copyrightable. And it has the standard GNU copyleft blurb at the top.

Post reply on HN