Are any parts of UNIX in public domain?

Gregory Smith greg at utcsri.UUCP
Mon May 5 11:32:35 AEST 1986


In article <235 at chronon.chronon.UUCP> eric at chronon.UUCP (Eric Black) writes:
>In article <512 at gould9.UUCP> joel at gould9.UUCP (Joel West) writes:
>>I hereby attest that I have not looked at any copyrighted or
>>license-restricted source code, and would like to place the
>>following in the public domain: :-)
>>
>>#!/bin/sh
>># Shar script
>>cat >true <<//EOF
>>exit 0
>>//EOF
>>chmod 755 true
>>cat >false <<//EOF
>>exit 1
>>//EOF
>>chmod 755 false
>>-- 
>
>A clear case of independent creation!  An idea whose time has come!
>(Of course, the question can be asked, "What other possible reasonable
>way could there be to do it?").

Here's both in one:

------tf.c-----------------
#include <strings.h>
#define NULL 0
main( fred, joe ) char *joe[];
{   register char *sue, *ellen;
    exit( strcmp( (sue = rindex( ellen = joe[0],'/'))==NULL?
	ellen: sue+1, "true" ) != 0 );
}
-----------------------------
It returns 0 if invoked as 'true' or as [path]/true and 1 otherwise,
so it can be linked-to twice to get both. This is *not* my entry to
the obfuscated C contest - that is much worse.

Ok, ok, so it compiles to 6K - But isn't it faster? Doesn't a new shell
get created for the 'exit 0' script, so would it be faster to load a
quickie like this?
I release the above to the public domain on condition that the variable
names are not changed. :-)

-- 
"Canabee be said2b or not2b anin tire b, if half thabee isnotabee, due2
somain chunt injury?" - Eric's Dilemma
----------------------------------------------------------------------
Greg Smith     University of Toronto      UUCP: ..utzoo!utcsri!greg



More information about the Comp.unix mailing list