Public Domain version of: yes(1)
Silver
gaynor at porthos.rutgers.edu
Mon Apr 11 05:00:09 AEST 1988
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 at 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 <stdio.h>
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 ====================
More information about the Alt.sources
mailing list