Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!greg From: greg@utcsri.UUCP (Gregory Smith) Newsgroups: net.unix,net.lang Subject: Re: Are any parts of UNIX in public domain? Message-ID: <2701@utcsri.UUCP> Date: Sun, 4-May-86 21:32:35 EDT Article-I.D.: utcsri.2701 Posted: Sun May 4 21:32:35 1986 Date-Received: Sun, 4-May-86 22:26:46 EDT References: <481@batcomputer.TN.CORNELL.EDU> <512@gould9.UUCP> <235@chronon.chronon.UUCP> Reply-To: greg@utcsri.UUCP (Gregory Smith) Organization: CSRI, University of Toronto Lines: 48 Summary: In article <235@chronon.chronon.UUCP> eric@chronon.UUCP (Eric Black) writes: >In article <512@gould9.UUCP> joel@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 <>exit 0 >>//EOF >>chmod 755 true >>cat >false <>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 #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