Newsgroups: alt.sources From: lamping@parc.xerox.com (John Lamping) Subject: shop - nonsense for connoisseurs (part 1/3) Message-ID: <1991Jul16.224755.19096@parc.xerox.com> Date: Tue, 16 Jul 1991 22:47:55 GMT Shop generates a random shopping list of deranged items. Such as: Here is your shopping list: (1) Buy & Break rooster skis (2) Inelegant sofas (3) Polemical breath lesions You can do all manner of ridiculous things with this. For example, the xterm window I'm working in right now bears the title "Antagonistic snore bacon." Also, this is nice to put in a C shell .logout program when you're working on a physical terminal. Some people (like me) find this sort of thing funny, but don't worry... we're getting professional help. The pindex program, also posted to alt.sources, is required for the use of shop. Be sure to install it before installing shop. I've successfully compiled this package on DG/UX, SunOS, and vanilla SVR4 systems. I'd like to hear of people's experiences with setting up the package under other operating systems; my e-mail address is rice@dg-rtp.dg.com . Also, please drop me a note concerning bugs, enhancements, and amusing applications. This is part 1/3. The shell archive below contains a README file, a man page, and all of the C source modules. Part 2/3 contains the program's vocabulary, and part 3/3 is a PostScript man page. Brian Rice rice@dg-rtp.dg.com +1 919 248-6328 DG/UX Product Assurance Engineering Data General Corp., Research Triangle Park, N.C. "Join with me in a MASS RALLY for TRADITIONAL MENTAL ATTITUDES!!" --Zippy #! /bin/sh # This is a shell archive. Remove anything before this line, then feed it # into a shell via "sh file" or similar. To overwrite existing files, # type "sh file -c". # The tool that generated this appeared in the comp.sources.unix newsgroup; # send mail to comp-sources-unix@uunet.uu.net if you want that tool. # If this archive is complete, you will see the following message at the end: # "End of shell archive." # Contents: README Makefile axatchar.c capwords.c getcount.c getnth.c # getitem.c my_rand.c shop.c shop.h shop.6 shop.lp # Wrapped by rice@mirage on Mon Jul 1 19:10:54 1991 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'README'\" else echo shar: Extracting \"'README'\" \(2331 characters\) sed "s/^X//" >'README' <<'END_OF_FILE' XREADME file for shop X==================== X XHowdy. This program is called shop, and it is extremely silly. XIt generates a random shopping list of deranged items. Such as: X X Here is your shopping list: X (1) Buy & Break rooster skis X (2) Inelegant sofas X (3) Polemical breath lesions X XYou can do all manner of ridiculous things with this. For example, Xthe xterm window I'm working in right now bears the title X"Antagonistic snore bacon." Also, this is nice to put in a XC shell .logout program. X XSome people (like me) find this sort of thing funny, but don't worry... Xwe're getting professional help. X XThe pindex program, also posted to alt.sources, is required for the use Xof shop. Be sure to install it, including the patch which updates pindex.c Xto revision 2.2, before installing shop. X XHere's what this package contains: X XREADME X This file. Xshop.6 X The troff -man source for the man page. Xshop.lp X A man page suitable for printing on a line printer. X A PostScript copy of the man page has also been posted to X alt.sources. XMakefile X A makefile for the whole package. You'll want to get in X and edit the first part of this, since it contains a whole X bunch of configurable items. Xnouns.raw Xadjs.raw X The program's vocabulary, in a non-indexed format. adjs.raw X contains one adjective-like thing per line. nouns.raw contains X pairs of lines: the first line in each pair is a noun-like thing, X and the second line is its plural form (or, if for some reason X it's not workable, some other plural or collective thing). Of X course, you may customize these. X The makefile for shop runs pindex to translate these files into X the indexed format which shop requires. Xshop.c Xshop.h Xaxatchar.c Xcapwords.c Xgetcount.c Xgetitem.c Xgetnth.c Xmy_rand.c X Various source modules for shop proper. Note especially X my_rand.c; it contains a random number function which returns X a long integer. If my_rand.c doesn't compile on your system, X you can just supply your own equivalent module. X XI've successfully compiled this package on DG/UX, SunOS, and vanilla XSVR4 systems. I'd like to hear of people's experiences with setting Xup the package under other operating systems; my e-mail address Xis rice@dg-rtp.dg.com . Also, please drop me a note concerning Xbugs, enhancements, and amusing applications. END_OF_FILE echo shar: NEWLINE appended to \"'README'\" if test 2332 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test -f 'Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Makefile'\" else echo shar: Extracting \"'Makefile'\" \(5164 characters\) sed "s/^X//" >'Makefile' <<'END_OF_FILE' X# This is the makefile for shop. X# Note that the random function, long my_rand() in my_rand.c, is only X# suitable if the size of a long on your system is 32 bits or more. X# If not, just write a my_rand() in terms of whatever random-number X# generation facility your environment offers. X# X# Note also that if you wish to update shop's database of phrases X# and words, you may do so by editing the raw files (note the X# noun file's format: in each pair of lines, the first is the X# singular and the second is the plural) then giving the command X# X# make lists X X# Brian Rice rice@dg-rtp.dg.com $Date: 91/07/01 18:45:56 $ X XINSTALL_DIR=/usr/local/bin X # Set to be the directory into which you would X # like the shop executable to be copied. XSHOPLIB_DIR=/usr/local/lib/shop X # Set to be the directory where indexed data files X # should live. This must be an absolute pathname-- X # that is, it must have the same interpretation X # regardless of what your current working directory X # is. (Under UNIX, this would mean that the X # pathname must begin with a slash.) XPINDEX_DIR=/usr/local/bin X # Set to be the directory in which you have X # installed pindex (also posted to alt.sources). X # If you haven't installed pindex yet, go do X # it now! XRAW_FILES_DIR=. X # Set to be the directory where source data X # files live. XCFLAGS= X # Compilation flags. XLFLAGS= X # Link editor flags. XCC=/usr/bin/cc X # Your C compiler. XPWD_SUPPORTED=1 X # Set to 1 if your system supports uids, X # delivered through the getpwent facility. X # Otherwise, set to 0. XDEFAULT_NAME="Mark McAuliffe" X # Set this to a name to use for the -m X # option if your system does not support getpwent. X # (It is ignored if PWD_SUPPORTED is 1.) XVERBOSE_GECOS=1 X # Set to 1 if the comment field of usernames at your X # site has fields other than the user's real name-- X # for instance... X # Brian Rice,,2486328, X # If the comment field has nothing but names in X # it, set VERBOSE_GECOS to 0. X # Why is it called GECOS? Those pesky historical X # reasons. XGECOS_DELIMITERS="," X # A list of all characters which serve to mark the X # end of users' real names in the comment field at X # your site. XPATHNAME_SEP=/ X # The character which separates pathname components X # at your site. XCOPY=cp X # Your command for copying a file. XEXECABLE=chmod 755 X # Your command for making a file executable. XTOUCH=touch X # Your command for touching a file. XMKDIR=mkdir X # Your command for creating a directory. X X# That's all the defines. X XNOUNFILE=$(SHOPLIB_DIR)$(PATHNAME_SEP)nouns.dat XPLURALFILE=$(SHOPLIB_DIR)$(PATHNAME_SEP)plurals.dat XADJFILE=$(SHOPLIB_DIR)$(PATHNAME_SEP)adjs.dat X XRAWNOUNFILE=$(RAW_FILES_DIR)$(PATHNAME_SEP)nouns.raw XRAWADJFILE=$(RAW_FILES_DIR)$(PATHNAME_SEP)adjs.raw X Xinstall: makedirs lists shop Xmakedirs: X -$(MKDIR) $(INSTALL_DIR) X -$(MKDIR) $(SHOPLIB_DIR) X -$(TOUCH) makedirs Xlists: $(RAWNOUNFILE) $(RAWADJFILE) X $(PINDEX_DIR)$(PATHNAME_SEP)pindex $(RAWADJFILE) $(ADJFILE) X $(PINDEX_DIR)$(PATHNAME_SEP)pindex -2 $(RAWNOUNFILE) \ X $(NOUNFILE) $(PLURALFILE) X -$(TOUCH) lists Xshop: shop.o capwords.o getcount.o getnth.o \ X getitem.o my_rand.o axatchar.o X $(CC) $(LFLAGS) -o shop shop.o capwords.o getcount.o \ X getnth.o getitem.o axatchar.o my_rand.o X -$(COPY) shop $(INSTALL_DIR) X -$(EXECABLE) $(INSTALL_DIR)$(PATHNAME_SEP)shop Xshop.o: shop.c shop.h X $(CC) $(CFLAGS) -c shop.c -DVERBOSE_GECOS=$(VERBOSE_GECOS) \ X -DPWD_SUPPORTED=$(PWD_SUPPORTED) -DDEFAULT_NAME=\"$(DEFAULT_NAME)\" Xcapwords.o: capwords.c shop.h X $(CC) $(CFLAGS) -c capwords.c \ X -DPWD_SUPPORTED=$(PWD_SUPPORTED) Xaxatchar.o: axatchar.c X $(CC) $(CFLAGS) -c axatchar.c \ X -DGECOS_DELIMITERS=\"$(GECOS_DELIMITERS)\" \ X -DPWD_SUPPORTED=$(PWD_SUPPORTED) Xgetcount.o: getcount.c X $(CC) $(CFLAGS) -c getcount.c Xgetnth.o: getnth.c X $(CC) $(CFLAGS) -c getnth.c \ X -DNOUN_FILE=\"$(NOUNFILE)\" \ X -DPLURAL_FILE=\"$(PLURALFILE)\" \ X -DADJ_FILE=\"$(ADJFILE)\" Xgetitem.o: getitem.c shop.h X $(CC) $(CFLAGS) -c getitem.c \ X -DNOUN_FILE=\"$(NOUNFILE)\" \ X -DPLURAL_FILE=\"$(PLURALFILE)\" \ X -DADJ_FILE=\"$(ADJFILE)\" Xmy_rand.o: my_rand.c X $(CC) $(CFLAGS) -c my_rand.c X X# RCS id of this makefile is $What: <@(#) Makefile,v 2.1> $. END_OF_FILE echo shar: NEWLINE appended to \"'Makefile'\" if test 5165 -ne `wc -c <'Makefile'`; then echo shar: \"'Makefile'\" unpacked with wrong size! fi # end of 'Makefile' fi if test -f 'axatchar.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'axatchar.c'\" else echo shar: Extracting \"'axatchar.c'\" \(299 characters\) sed "s/^X//" >'axatchar.c' <<'END_OF_FILE' X/* ax_at_char.c X part of the shop package */ X X#if PWD_SUPPORTED Xstatic char rcsid[] = "$What: <@(#) axatchar.c,v 2.1> $"; X X#include X Xchar *ax_at_char(buff) Xchar *buff; X{ X char *s, *strpbrk(); X X if ((s = strpbrk(buff,GECOS_DELIMITERS)) != NULL) { X *s = '\0'; X } X return buff; X} X#endif END_OF_FILE echo shar: NEWLINE appended to \"'axatchar.c'\" if test 300 -ne `wc -c <'axatchar.c'`; then echo shar: \"'axatchar.c'\" unpacked with wrong size! fi # end of 'axatchar.c' fi if test -f 'capwords.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'capwords.c'\" else echo shar: Extracting \"'capwords.c'\" \(331 characters\) sed "s/^X//" >'capwords.c' <<'END_OF_FILE' X#include X#include "shop.h" X Xchar *cap_words(buff) Xchar *buff; X{ X BOOLEAN capnext = TRUE; X char *s; X X s = buff; X X while (*s) { X if (isalpha(*s)) { X if (capnext) { X *s = toupper(*s); X } X capnext = FALSE; X } else if (isspace(*s)) { X capnext = TRUE; X } else { X capnext = FALSE; X } X ++s; X } X X return buff; X} END_OF_FILE echo shar: NEWLINE appended to \"'capwords.c'\" if test 332 -ne `wc -c <'capwords.c'`; then echo shar: \"'capwords.c'\" unpacked with wrong size! fi # end of 'capwords.c' fi if test -f 'getcount.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'getcount.c'\" else echo shar: Extracting \"'getcount.c'\" \(404 characters\) sed "s/^X//" >'getcount.c' <<'END_OF_FILE' X/* X * get_count.c Brian Rice rice@dg-rtp.dg.com 1989 X * This routine is part of the shop package. X * It takes advantage of the fact that the first sizeof(long) bytes X * in the file named by f are a long which gives the number of X * items in that file. X */ X#include X Xlong int get_count(f) XFILE *f; X{ X long int c = 0L; X X rewind(f); X (void) fread(&c,sizeof c,1,f); X X return c; X} X END_OF_FILE echo shar: NEWLINE appended to \"'getcount.c'\" if test 405 -ne `wc -c <'getcount.c'`; then echo shar: \"'getcount.c'\" unpacked with wrong size! fi # end of 'getcount.c' fi if test -f 'getnth.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'getnth.c'\" else echo shar: Extracting \"'getnth.c'\" \(777 characters\) sed "s/^X//" >'getnth.c' <<'END_OF_FILE' X/* X * get_nth_string.c Brian Rice rice@dg-rtp.dg.com 1989 X * This routine is part of the shop package. X * It takes advantage of the fact that the first sizeof(long) bytes X * in the file named by f are a long which gives the number of X * items in that file. X */ X X#include X#include "shop.h" X Xchar *get_nth_string(f,n,buff,l) XFILE *f; Xlong int n; Xchar *buff; Xint l; X{ X long int begin_loc, end_loc; X int s_length; X X (void) fseek(f,n*BYTE_COUNT_SIZE+ITEM_COUNT_SIZE,0); X (void) fread(&begin_loc,sizeof begin_loc,1,f); X (void) fread(&end_loc,sizeof end_loc,1,f); X X s_length = end_loc - begin_loc; X X if (s_length > l - 1) X s_length = l - 1; X X (void) fseek(f,begin_loc,0); X X (void) fread(buff,sizeof(char),s_length,f); X X buff[s_length] = '\0'; X X return buff; X} END_OF_FILE echo shar: NEWLINE appended to \"'getnth.c'\" if test 778 -ne `wc -c <'getnth.c'`; then echo shar: \"'getnth.c'\" unpacked with wrong size! fi # end of 'getnth.c' fi if test -f 'getitem.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'getitem.c'\" else echo shar: Extracting \"'getitem.c'\" \(2936 characters\) sed "s/^X//" >'getitem.c' <<'END_OF_FILE' X#include X#include X#include X#include "shop.h" X Xstatic FILE *nounfile, *pluralfile, *adjfile; Xstatic int files_opened = FALSE; Xstatic long int number_of_nouns = -1L; Xstatic long int number_of_plurals = -1L; Xstatic long int number_of_adjs = -1L; X Xextern char *cmdname; X Xchar *getitem(buff) Xchar *buff; X{ X long int my_rand(); X X long int which_noun1 = 0L; X long int which_noun2 = 0L; X long int which_adj1 = 0L; X long int which_adj2 = 0L; X X char adj1[MAX_WORD_LEN], adj2[MAX_WORD_LEN], X noun1[MAX_WORD_LEN], noun2[MAX_WORD_LEN]; X char *get_nth_string(); X long int get_count(); X X if (!files_opened) { X nounfile = fopen(NOUN_FILE,"r"); X if (nounfile == NULL) { X (void) fprintf(stderr, X "%s: couldn't open noun file.\n", X cmdname); X exit(1); X } X X pluralfile = fopen(PLURAL_FILE,"r"); X if (pluralfile == NULL) { X (void) fprintf(stderr, X "%s: couldn't open plural file.\n", X cmdname); X exit(1); X } X X adjfile = fopen(ADJ_FILE,"r"); X if (adjfile == NULL) { X (void) fprintf(stderr, X "%s: couldn't open adjective file.\n", X cmdname); X exit(1); X } X files_opened = TRUE; X } X X if (number_of_nouns < 0) { X number_of_adjs = get_count(adjfile); X number_of_nouns = get_count(nounfile); X number_of_plurals = get_count(pluralfile); X if (number_of_plurals != number_of_nouns) { X (void) fprintf(stderr, X "%s: plural file has %d elements; noun file, %d\n", X cmdname,number_of_plurals, number_of_nouns); X exit(1); X } X } X X noun1[0] = '\0'; X noun2[0] = '\0'; X adj1[0] = '\0'; X adj2[0] = '\0'; X X switch(my_rand() % 5) { X case 4: /*FALLTHROUGH*/ X case 3: X which_noun1 = (long) (my_rand() % number_of_nouns); X get_nth_string(nounfile, X which_noun1,noun1,MAX_WORD_LEN); X (void) strcat(noun1," "); X /*FALLTHROUGH*/ X case 2: /*FALLTHROUGH*/ X case 1: /*FALLTHROUGH*/ X case 0: X while ((which_noun2 = X (long) (my_rand() % number_of_nouns)) X == which_noun1) X /* do nothing */; X get_nth_string(pluralfile, X which_noun2,noun2,MAX_WORD_LEN); X } X X switch(my_rand() % 4) { X case 3: X which_adj1 = (long) (my_rand() % number_of_adjs); X get_nth_string(adjfile,which_adj1,adj1,MAX_WORD_LEN); X (void) strcat(adj1," "); X /*FALLTHROUGH*/ X case 2: /*FALLTHROUGH*/ X case 1: /*FALLTHROUGH*/ X case 0: X while ((which_adj2 = X (long) (my_rand() % number_of_adjs)) == which_adj1) X /* do nothing */; X get_nth_string(adjfile,which_adj2,adj2,MAX_WORD_LEN); X (void) strcat(adj2," "); X } X X (void) sprintf(buff,"%s%s%s%s",adj1,adj2,noun1,noun2); X X return buff; X} END_OF_FILE echo shar: NEWLINE appended to \"'getitem.c'\" if test 2937 -ne `wc -c <'getitem.c'`; then echo shar: \"'getitem.c'\" unpacked with wrong size! fi # end of 'getitem.c' fi if test -f 'my_rand.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'my_rand.c'\" else echo shar: Extracting \"'my_rand.c'\" \(1369 characters\) sed "s/^X//" >'my_rand.c' <<'END_OF_FILE' X/* X * my_rand.c $Date: 91/07/01 18:45:25 $ X * $What: <@(#) my_rand.c,v 2.1> $ X */ X X/* X * This random number generator is from Park and Miller, X * "Random Number Generators: Good Ones Are Hard to Find," X * _Communications of the ACM_, vol. 31, no. 10 (Oct. 1988), X * pp. 1192-1201. X * X * NOTE that this implementation is only suitable on systems X * where a long integer is 32 bits wide. X */ X X/* X * I use the current time (the number of seconds since the UNIX X * epoch, as returned by time()) as a random number seed. Obviously, X * if your system doesn't support time(), you will have do to X * something else. Note also that there's nothing special about X * either time or the UNIX epoch; any routine which returns a X * long int and doesn't always return the same thing will be O.K. X */ X X#include X#include X X#ifndef NULL X#define NULL 0 X#endif X X#include "shop.h" X X#define A 16807 X#define M 2147483647 X#define Q 127773 X#define R 2836 X X/* X * Q is M / A, while R is M mod A. X */ X Xstatic BOOLEAN seed_set = FALSE; Xstatic long int my_seed; X Xlong int my_rand() X{ X long int lo, hi, test; X time_t time(); X X if (!seed_set) { X my_seed = (long int) time(NULL); X seed_set = TRUE; X } X X hi = (long) (my_seed / Q); X lo = my_seed - Q * hi; X test = A * lo - R * hi; X if (test > 0) { X my_seed = test; X } else { X my_seed = test + M; X } X return my_seed; X} END_OF_FILE echo shar: NEWLINE appended to \"'my_rand.c'\" if test 1370 -ne `wc -c <'my_rand.c'`; then echo shar: \"'my_rand.c'\" unpacked with wrong size! fi # end of 'my_rand.c' fi if test -f 'shop.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shop.c'\" else echo shar: Extracting \"'shop.c'\" \(1965 characters\) sed "s/^X//" >'shop.c' <<'END_OF_FILE' X/* X * shop Brian Rice rice@dg-rtp.dg.com 1989-91 X * X * This is shop.c, the main routine. X * X * $Date: 91/07/01 18:45:31 $ X */ X Xstatic char rcsid[] = "$What: <@(#) shop.c,v 2.1> $"; X X#include X#include X#include X X#if PWD_SUPPORTED X#include X#endif X X#include "shop.h" X Xchar *cmdname; X Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X char *getitem(); X char *cap_words(); X#if PWD_SUPPORTED X struct passwd *getpwuid(), *my_passwd; X#if VERBOSE_GECOS X char *ax_at_char(); X#endif X#endif X char my_text[MY_TEXT_LENGTH]; X BOOLEAN middname = FALSE; X BOOLEAN header = TRUE; X BOOLEAN numbers = TRUE; X int inx; X int itemcount = DEFAULT_ITEMCOUNT; X char *s; X X cmdname = argv[0]; X X while (--argc > 0) { X switch ((*++argv)[0]) { X case '-': X for (s = argv[0]+1; *s; s++) X switch (*s) { X case 'h': header = FALSE; X break; X case 'n': numbers = FALSE; X break; X case 'm': middname = TRUE; X break; X default: X (void) X fprintf(stderr, X SHOP_USAGE, X cmdname); X exit(1); X } X break; X case '0': X case '1': X case '2': X case '3': X case '4': X case '5': X case '6': X case '7': X case '8': X case '9': itemcount = atoi(argv[0]); X break; X } X } X X if (middname) { X#if PWD_SUPPORTED X my_passwd = getpwuid(getuid()); X#endif X X (void) printf("%s, your middle name is \"%s.\"\n", X#if PWD_SUPPORTED X#if VERBOSE_GECOS X ax_at_char(my_passwd->pw_gecos), X#else X my_passwd->pw_gecos, X#endif X#else X DEFAULT_NAME, X#endif X cap_words(getitem(my_text))); X } else { X if (header) { X (void) printf(HEADER_MSG); X } X X for (inx=0; inx < itemcount; inx++) { X (void) getitem(my_text); X my_text[0] = toupper(my_text[0]); X if (numbers) { X (void) printf("(%d) %s",inx+1,my_text); X } else { X (void) fputs(my_text,stdout); X } X (void) putc('\n',stdout); X } X } X exit(0); X /*NOTREACHED*/ X} END_OF_FILE echo shar: NEWLINE appended to \"'shop.c'\" if test 1966 -ne `wc -c <'shop.c'`; then echo shar: \"'shop.c'\" unpacked with wrong size! fi # end of 'shop.c' fi if test -f 'shop.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shop.h'\" else echo shar: Extracting \"'shop.h'\" \(408 characters\) sed "s/^X//" >'shop.h' <<'END_OF_FILE' X/* X * shop.h $Date: 91/07/01 18:45:50 $ X * $What: <@(#) shop.h,v 2.1> $ X */ X X#ifndef TRUE X#define TRUE 1 X#define FALSE 0 X#endif X#ifndef BOOLEAN X#define BOOLEAN char X#endif X#define BYTE_COUNT_SIZE 4 X#define ITEM_COUNT_SIZE 4 X#define MAX_WORD_LEN 32 X#define DEFAULT_ITEMCOUNT 3 X#define MY_TEXT_LENGTH 128 X#define HEADER_MSG "Here is your shopping list:\n" X X#define SHOP_USAGE "%s: legal options are h m n\n" END_OF_FILE echo shar: NEWLINE appended to \"'shop.h'\" if test 409 -ne `wc -c <'shop.h'`; then echo shar: \"'shop.h'\" unpacked with wrong size! fi # end of 'shop.h' fi if test -f 'shop.6' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shop.6'\" else echo shar: Extracting \"'shop.6'\" \(2147 characters\) sed "s/^X//" >'shop.6' <<'END_OF_FILE' X.\" $What: <@(#) shop.6,v 2.1> $ X.RV 2.00 X.TH shop 6 X.MX "shop(6)" X.SH NAME Xshop \- print a shopping list X.SH SYNTAX X.B shop X[ [ X.B \-hn X] [ \fInumber\fP ] ] X.PP X.B shop \-m X.SH DESCRIPTION X.I Shop\^ Xsuggests some items which you may want to pick up on your Xnext visit to the five-and-dime. XYou may specify a non-negative integer on the command line Xto specify how many suggestions you would like; the default Xis three. X.PP XWhen X.I shop\^ Xis used with the X.B \-m Xflag (the Mark McAuliffe Memorial Option), shop will instead Xaccuse you of having a particular middle name. X.PP X.SH OPTIONS X.TP 5 X.B \-h XDon't print a header (``Here is your shopping list:'') for the output. X.TP X.B \-n XDon't number the items. X.TP X.I number XEmit the given non-negative number of items instead of the default three. X.TP X.B \-m XAccuse the user of having a certain middle name. Overrides \fB-h\fP Xand \fB-n\fP. X.PP X.SH EXAMPLES X.PP XTo get a default shopping list, issue the command: X.sp X.RS X.ft CW Xshop X.ft R X.RE X.sp X.I Shop\^ Xwould reply with something like X.sp X.RS X.ft CW XHere is your shopping list: X.br X(1) Cylindrical wavechords X.br X(2) Pelvic anaerobic ink obsessions X.br X(3) Hobnobbing roosters X.ft R X.RE X.sp X.PP XTo give an \fIxterm\fP(1) a shopping-list item as a title, start it Xlike this: X.RS X.ft CW Xxterm -title "`shop -hn 1`" & X.ft R X.RE X.sp X.PP X.SH FILES X.TP 18 Xnouns.dat X.TP 15 Xplurals.dat X.TP 15 Xadjs.dat XThese files store the program's vocabulary in an indexed format; their Xlocation is installer-configurable. X.TP 15 X/etc/passwd X.SH SEE ALSO X\fIpindex\fP(1) X.PP X\fIThe Harvard Lampoon Big Book of College Life\fR, which was the Xsource of inspiration for this program, as well as some of Xits more eccentric vocabulary. May I say, in hopes of not getting Xsued, that everyone should buy this book, preferably multiple copies. X.PP X.SH AUTHOR XBrian Rice. X.TP 12 X(Internet) X\&\fIrice@dg-rtp.dg.com\fP X.TP 12 X(UUCP) X\&\fI...!mcnc!rti!xyzzy!rice\fP X.TP 12 X(BITNET) X\&\fIBALOGA@DRYCAS\fP X.PP XI would appreciate your notifying me of any bugs you discover. X.PP X.SH COPYRIGHT XThis program is in the public domain. Everyone may use it as he or Xshe sees fit. END_OF_FILE echo shar: NEWLINE appended to \"'shop.6'\" if test 2148 -ne `wc -c <'shop.6'`; then echo shar: \"'shop.6'\" unpacked with wrong size! fi # end of 'shop.6' fi if test -f 'shop.lp' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shop.lp'\" else echo shar: Extracting \"'shop.lp'\" \(3364 characters\) sed "s/^X//" >'shop.lp' <<'END_OF_FILE' X X X X shop(6) UNIX System V shop(6) X X X X NAME X shop - print a shopping list X X SYNTAX X shop [ [ -hn ] [ ______ ] ] X X shop -m X X DESCRIPTION X ____ suggests some items which you may want to pick up on X your next visit to the five-and-dime. You may specify a X non-negative integer on the command line to specify how many X suggestions you would like; the default is three. X X When ____ is used with the -m flag (the Mark McAuliffe X Memorial Option), shop will instead accuse you of having a X particular middle name. X X OPTIONS X -h Don't print a header (``Here is your shopping list:'') X for the output. X X -n Don't number the items. X X ______ X Emit the given non-negative number of items instead of X the default three. X X -m Accuse the user of having a certain middle name. X Overrides -h and -n. X X EXAMPLES X To get a default shopping list, issue the command: X X shop X X ____ would reply with something like X X Here is your shopping list: X (1) Cylindrical wavechords X (2) Pelvic anaerobic ink obsessions X (3) Hobnobbing roosters X X X To give an _____(1) a shopping-list item as a title, start X it like this: X xterm -title "`shop -hn 1`" & X X X FILES X nouns.dat X X X X X Page 1 (printed 7/1/91) X X X X X X X shop(6) UNIX System V shop(6) X X X X plurals.dat X X adjs.dat These files store the program's vocabulary in X an indexed format; their location is X installer-configurable. X X /etc/passwd X X SEE ALSO X ______(1) X X ___ _______ _______ ___ ____ __ _______ ____, which was the X source of inspiration for this program, as well as some of X its more eccentric vocabulary. May I say, in hopes of not X getting sued, that everyone should buy this book, preferably X multiple copies. X X AUTHOR X Brian Rice. X X (Internet) ____@__-___.__.___ X X (UUCP) ...!____!___!_____!____ X X (BITNET) ______@______ X X I would appreciate your notifying me of any bugs you X discover. X X COPYRIGHT X This program is in the public domain. Everyone may use it X as he or she sees fit. X X X X X X X X X X X X X X X X X X X X X X X X Page 2 (printed 7/1/91) X X X END_OF_FILE echo shar: NEWLINE appended to \"'shop.lp'\" if test 3365 -ne `wc -c <'shop.lp'`; then echo shar: \"'shop.lp'\" unpacked with wrong size! fi # end of 'shop.lp' fi echo shar: End of shell archive. exit 0