Xref: utzoo alt.sources:161 comp.os.minix:2565 Path: utzoo!mnetor!uunet!husc6!rutgers!aramis.rutgers.edu!porthos.rutgers.edu!gaynor From: gaynor@porthos.rutgers.edu (Silver) Newsgroups: alt.sources,comp.os.minix Subject: Re: Public Domain version of: yes(1) Message-ID: Date: 10 Apr 88 19:00:09 GMT References: <4571@chinet.UUCP> <310@rolls.UUCP> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 48 Keywords: Free Software Hi everybody! Since we're so intent on continuing this discussion, and I need a break from the *real* stuff for a minute, I decided to write my own yes! I phoned my folks, and got my mom to work on her version in Lotus. My dad doesn't know any computer languages, but at least he can type for my mom... Rex (our dog) knows Logo, and is de-flea-ing his version as I tap. I've posted calls for versions to all the networks and PA-Unix boxes to which I have easy access; I volunteer to painfully post each one seperately. This satisfies my sun's man page of yes. ==================== yes.c ==================== /************************* DISCLAIMER **************************\ * PUBLIC DOMAIN, DAMAGES DISCLAIMED! [Ag] gaynor@rutgers.edu * \***************************************************************/ /********************** yes [ expletive ] **********************\ * * * Continuously output an expletive until terminated externally. * * Expletive may be supplied as an argument on the command line, * * defaulting to "y" if not. * * * \***************************************************************/ #include int main(argc, argv) int argc; char * argv[]; {char * expletive; /* Points to the string which is to be output. */ {/* Parse arguments: Set expletive to optional argument if supplied, or "y" otherwise. */ switch (argc) {case 1: expletive = "y"; break; case 2: expletive = argv[1]; break; default: (void) fprintf(stderr, "usage: %s [ expletive ]\n", argv[0]); exit(1);}} {/* Do work: Output expletive continuously. */ forever: /* Ha! A structured use of goto! */ (void) puts(expletive); goto forever;}} ==================== yes.c ====================