Unpublished Source Code

Recently while stumbling my way through Solaris I came across a command I’m not familiar with. /usr/bin/true is a shell script which when run will return true (execute successfully.)

Now, this code clearly goes back a bit into UNIX history and I was amused to see exactly how the developers coded it. With that in mind, and against all copyrights and rights reservations I now present the complete and unabridged code for /usr/bin/true:

bash-2.03$ more /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 */

Why on earth would you copyright this? Perhaps even more impressive is the point that this is version 1.6! What did previous versions of this look like? And why such a big deal about this being unpublished source code? Hell, it’s not even source code, let alone published.

Well, if you’re curious, this script is all comments, therefore when it is run it does nothing… Of course it does nothing quite successfully, therefore returning ‘true’ for the purposes of evaluating conditions.

I do have to give the developers of this credit for simplicity. I’m sure if it weren’t for the lawyers this could have been a one line file.

unix, solaris, source code, programming, development, opensource

4 thoughts on “Unpublished Source Code”

  1. Shades of the IBM/360 utility program IEFBR14. Consisted of just a return statement (BR 14). Should have been only 2 bytes long – can anyone out there check for the copyright notice?

  2. IBM actually had to patch IEFBR14. The original didn’t set the return value to 0 in register 15.

  3. i was one of the Solaris developers who had the unenviable task of tracking history and copyright of many of these old AT&T bits of code… in particular i tracked the history of this one. i too wondered “if this is version 1.6, what did versions 0.1 through 1.5 look like?????”

    turns out, SCCS (the file based SCM used), auto-incremented those versions #’s. so anytime things changed universally (e.g. copyright, code style, etc.), that # auto-incremented.

Leave a Reply

Your email address will not be published. Required fields are marked *