home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume1 / uucpanz.s5 < prev    next >
Internet Message Format  |  1986-11-30  |  16KB

  1. From: decvax!sun!amdahl!gam (Gordon A. Moffett)
  2. Date: Thu, 8 Nov 84 08:58:07 PST
  3. Subject: uucpanz for System V
  4.  
  5. : This is a shar archive.  Extract with sh, not csh.
  6. echo x - README
  7. sed -e 's/^X//' > README << '!Funky!Stuff!'
  8. XThe files herein are:
  9. X
  10. Xuucpanz.h - header file for uucpanz.c
  11. Xuucpanz.c - C program source
  12. XMakefile  - instructions for compilation for make(1)
  13. Xuucpanz.1 - manual page
  14. XREADME    - this file.
  15. X
  16. XNote that this is assured to work only on System V Release 2 sites.
  17. !Funky!Stuff!
  18. echo x - uucpanz.1
  19. sed -e 's/^X//' > uucpanz.1 << '!Funky!Stuff!'
  20. X.TH UUCPANZ 1
  21. X.SH NAME
  22. Xuucpanz \- summarize uucp statistics
  23. X.SH SYNOPSIS
  24. X.B uucpanz
  25. X[
  26. X.B \-l
  27. Xlogfile ] [
  28. X.B \-s
  29. Xsyslog ]
  30. X.SH DESCRIPTION
  31. X.I Uucpanz
  32. Xexamines the files
  33. X.I logfile
  34. Xand
  35. X.I syslog
  36. X(by default, /usr/spool/uucp/LOGFILE and /usr/spool/uucp/SYSLOG,
  37. Xrespectively) and produces a report summarizing the data therein.
  38. X.P
  39. XThe report consists of 4 parts:
  40. X.TP 15
  41. XBy system:
  42. XThe number of bytes sent to and received from each uucp node,
  43. Xas well as the number of calls and their status, and the number
  44. Xof files transfered.  An average number of bytes per second transmitted
  45. Xis printed for both directions, if applicable.
  46. X.TP 15
  47. XBy user:
  48. XThe number of files and bytes sent by users (directly, via
  49. X.IR uucp (1),
  50. Xor indirectly by use of some other command).  This list is roughly
  51. Xsorted in reverse order.
  52. X.TP 15
  53. XBy commands:
  54. XCommands issued directly or indirectly via
  55. X.IR uux (1),
  56. Xwith a repetition count.
  57. X.TP 15
  58. XBy day:
  59. XTotal number of bytes sent or received for each day.
  60. X.P
  61. XThe users, uucp nodes, commands, and days are those found in the
  62. Xtwo input files; if no activity occurs for some uucp site it is
  63. Xnot reported.
  64. X.SH FILES
  65. X.TP 24
  66. X/usr/spool/uucp/LOGFILE
  67. Xdefault
  68. X.I logfile
  69. Xfrom which the summary of commands, phone calls, and file counts
  70. Xis created.
  71. X.TP 24
  72. X/usr/spool/uucp/SYSLOG
  73. Xdefault
  74. X.I syslog
  75. Xfrom which the summary of bytes and connect times is created.
  76. X.SH SEE ALSO
  77. Xuusub(1), uustat(1)
  78. X.br
  79. X``UUCP Adminstration'' in the
  80. X.I
  81. XUnix Administrator Guide
  82. X.SH DIAGNOSTICS
  83. X.TP 20
  84. X``Out of memory''
  85. X.I Uucpanz
  86. Xdynamically allocates memory to build linked lists for the
  87. Xcommand and user summaries.  The greater the number of unique
  88. Xcommands and usernames, the more memory is allocated.
  89. X.SH WARNINGS
  90. XThe program is very sensitive to the file formats for
  91. X.I logfile
  92. Xand
  93. X.I syslog
  94. Xand expects them to be just as they are produced by
  95. X.IR uucico (1m).
  96. X.SH BUGS
  97. XDoes not recover well from garbage data.
  98. X.P
  99. XThis program should be written in
  100. X.IR awk (1).
  101. !Funky!Stuff!
  102. echo x - uucpanz.h
  103. sed -e 's/^X//' > uucpanz.h << '!Funky!Stuff!'
  104. X#define    SYSLOG    "/usr/spool/uucp/SYSLOG"
  105. X#define    LOGFILE    "/usr/spool/uucp/LOGFILE"
  106. X#define    MAXSYS    32
  107. X
  108. Xstruct    dayrec {
  109. X    int used;    /* used */
  110. X    long recv;    /* bytes recv */
  111. X    long sent;    /* bytes sent */
  112. X    long trecv;    /* seconds spent rec */
  113. X    long tsent;    /* seconds spent sending */
  114. X};
  115. X
  116. Xstruct    sys1 {
  117. X    char sname[9];    /* system name */
  118. X    long bbsent;    /* bytes sent */
  119. X    long brec;    /* bytes rec. */
  120. X    long btsent;    /* time spen sending */
  121. X    long btrec;    /* time spent rec */
  122. X    int suc;    /* succesfull calls */
  123. X    int fail;    /* calls fail */
  124. X    int ugot;    /* number of files we got */
  125. X    int lock;    /* times of locked */
  126. X    int usent;    /* number of files we sent */
  127. X    int okstr;    /* number of conversations started */
  128. X    int okstop;    /* number of conversations stop */
  129. X};
  130. X
  131. Xstruct    users {
  132. X    char *name;    /* login name */
  133. X    long bsent;    /* bytes sent */
  134. X    long utim;    /* time spent */
  135. X    long nsent;    /* number sent */
  136. X    struct    users    *nuser;
  137. X};
  138. X
  139. Xstruct    call {
  140. X    int times;
  141. X    char *cname;
  142. X    struct call *ncall;
  143. X};
  144. !Funky!Stuff!
  145. echo x - uucpanz.c
  146. sed -e 's/^X//' > uucpanz.c << '!Funky!Stuff!'
  147. X/*
  148. X* uucpanz.c
  149. X*    program to print out stats about uucp usage.
  150. X*
  151. X*  Permission is given by me [ Brad Smith ] for the use,
  152. X* modification, and distribution of this program
  153. X* exception:  It may not be sold for profit individually nor as part of any
  154. X* software package, regardless of modifications.
  155. X*
  156. X*
  157. X*    Bradley Smith
  158. X*    Bradley University
  159. X*    {ihnp4,cepu,uiucdcs,noao}!bradley!brad
  160. X*
  161. X*       modified for System V Release 2
  162. X*       by Gordon A. Moffett
  163. X*       Amdahl Corporation
  164. X*       {ihnp4,hplabs}!amdahl!gam
  165. X*/
  166. X#include    <stdio.h>
  167. X#include    <ctype.h>
  168. X
  169. X#include    "uucpanz.h"
  170. X
  171. Xstruct    dayrec    dayacc[13] [32];
  172. Xstruct    sys1    sysacc[MAXSYS];
  173. Xstruct    call    *cmd, *tcall();
  174. Xstruct    users    *usage;
  175. X
  176. Xstruct    users    *tree();
  177. Xchar    *getfield();
  178. Xchar    *strchr();
  179. Xchar    *malloc(), *strsave();
  180. Xchar    *strcpy(), *strcat();
  181. Xvoid    exit();
  182. X
  183. Xlong    byt, tim, atol();
  184. Xint    cmdcount;
  185. Xlong    hour, min,second, hourtmp;
  186. XFILE *fpin;
  187. Xchar    *logfile = LOGFILE;
  188. Xchar    *syslog = SYSLOG;
  189. X
  190. Xchar            *Cmdname;
  191. X
  192. Xmain(argc, argv)
  193. X    int argc;
  194. X    char *argv[];
  195. X{
  196. X    char line[512], field[128], cx[128],*cp, *sp, *c;
  197. X    char junk[512];
  198. X    char sysname[18], username[9];
  199. X    register int i,j;
  200. X    int d, m;
  201. X    int opt;
  202. X    extern char *optarg;
  203. X    extern int   optind;
  204. X
  205. X    Cmdname = argv[0];
  206. X
  207. X    while ( (opt = getopt(argc, argv, "l:s:")) != EOF) {
  208. X    switch(opt) {
  209. X    case 'l':
  210. X        logfile = optarg;
  211. X        break;
  212. X    case 's':
  213. X        syslog = optarg;
  214. X        break;
  215. X    case '?':
  216. X    default:
  217. X        tellem();
  218. X    }
  219. X    }
  220. X/* intialize */
  221. X    usage = NULL;
  222. X    cmdcount = 0;
  223. X    cmd = NULL;
  224. X
  225. X/* lets do SYSLOG first */
  226. X
  227. X    if((fpin = fopen(syslog,"r")) == NULL)
  228. X        error(syslog);
  229. X
  230. X    while(fgets(line, sizeof line, fpin) != NULL) {
  231. X        fgets(junk, sizeof junk, fpin);     /* skip over 2nd line */
  232. X        strcpy(cx,getfield(2,line,' '));
  233. X        cp = cx;
  234. X        cp++;    /* puts at first number */
  235. X        c = cp;
  236. X        cp++;
  237. X        if(isdigit(*cp))
  238. X            cp++;
  239. X        *cp = '\0';
  240. X        m = atoi(c);
  241. X        cp++;
  242. X        c = cp;
  243. X        cp++;
  244. X        if(isdigit(*cp))
  245. X            cp++;
  246. X        *cp = '\0';
  247. X        d = atoi(c);
  248. X        strcpy(sysname, getfield(0,line,' '));
  249. X        cp = strchr(sysname, '!');
  250. X        if (cp == NULL) {
  251. X        fprintf(stderr, "%s\n", line);
  252. X        error("no '!' in 0th field");
  253. X        }
  254. X        *cp++ = '\0';    /* cp now points to user name */
  255. X        byt = atol(getfield(7,line,' '));
  256. X        tim = atol(getfield(9,line,' '));
  257. X        strcpy(username, cp);
  258. X        strcpy(field,getfield(6,line,' '));
  259. X
  260. X        if(tindex(field,"->") != -1) {
  261. X            for(i = 0;i < MAXSYS;i ++) {
  262. X              if(strlen(sysacc[i].sname) <= 0) {
  263. X                strcpy(sysacc[i].sname, sysname);
  264. X                sysacc[i].bbsent = byt;
  265. X                sysacc[i].btsent = tim;
  266. X                break;
  267. X              }
  268. X              else if(strcmp(sysacc[i].sname, sysname) == 0) {
  269. X                sysacc[i].bbsent += byt;
  270. X                sysacc[i].btsent += tim;
  271. X                break;
  272. X              }
  273. X            }
  274. X            usage = tree(usage, username);
  275. X            dayacc[m][d].sent += byt;
  276. X            dayacc[m][d].tsent += tim;
  277. X            dayacc[m][d].used = 1;
  278. X        }
  279. X        else {
  280. X            dayacc[m][d].recv += byt;
  281. X            dayacc[m][d].trecv += tim;
  282. X            dayacc[m][d].used = 1;
  283. X            for(i=0;i< MAXSYS; i++) {
  284. X              if(strlen(sysacc[i].sname) <= 0) {
  285. X                strcpy(sysacc[i].sname, sysname);
  286. X                sysacc[i].brec = byt;
  287. X                sysacc[i].btrec = tim;
  288. X                break;
  289. X              }
  290. X              else if(strcmp(sysacc[i].sname, sysname) == 0) {
  291. X                sysacc[i].brec += byt;
  292. X                sysacc[i].btrec += tim;
  293. X                break;
  294. X              }
  295. X            }
  296. X        }
  297. X    }
  298. X    fclose(fpin);
  299. X
  300. X    if((fpin = fopen(logfile,"r")) == NULL )
  301. X        error(logfile);
  302. X
  303. X    while(fgets(line, sizeof line, fpin) != NULL) {
  304. X        c = getfield(3,line,' ');
  305. X        strcpy(sysname, getfield(0, line, ' '));
  306. X        sp = strchr(sysname, '!');
  307. X        if (sp == NULL) {
  308. X        fprintf(stderr, "%s\n", line);
  309. X        error("no '!' in 0th field");
  310. X        }
  311. X        *sp++ = '\0';
  312. X        if(strcmp(c,"XQT") == 0) {
  313. X            strcpy(field, sysname);
  314. X            strcat(field, "!");
  315. X            strcat(field,getfield(3,line,'('));
  316. X            field[strlen(field)-3] = '\0';
  317. X            cmd = tcall(cmd,field);
  318. X        }
  319. X        else if(tindex(getfield(4,line,' '),"call") != -1) {
  320. X            cp = getfield(3,line,' ');
  321. X            if(strcmp(cp,"SUCCEEDED") == 0)
  322. X                for(i=0;i< MAXSYS;i++) {
  323. X                  if(strcmp(sysacc[i].sname,sysname) == 0)
  324. X                    sysacc[i].suc++;
  325. X            }
  326. X            else if(strcmp(cp,"FAILED") == 0) {
  327. X                for(i=0;i< MAXSYS;i++)
  328. X                  if(strcmp(sysacc[i].sname,sysname) == 0)
  329. X                    sysacc[i].fail++;
  330. X            }
  331. X            else if(strcmp(cp,"LOCKED") == 0) {
  332. X                for(i=0;i< MAXSYS;i++)
  333. X                  if(strcmp(sysacc[i].sname,sysname) == 0)
  334. X                    sysacc[i].lock++;
  335. X            }
  336. X        }
  337. X        cp = getfield(3,line,' ');
  338. X        if(strcmp(cp,"REQUESTED") == 0) {
  339. X            for(i=0;i< MAXSYS;i++)
  340. X              if(strcmp(sysacc[i].sname,sysname) == 0)
  341. X                sysacc[i].usent++;
  342. X        }
  343. X        else if(strcmp(cp,"COPY") == 0) {
  344. X            for(i=0;i< MAXSYS;i++) {
  345. X              if(strcmp(sysacc[i].sname,sysname) == 0)
  346. X                sysacc[i].ugot++;
  347. X            }
  348. X        }
  349. X        else if(strcmp(cp,"OK") == 0) {
  350. X            if(tindex(getfield(4,line,' '),"startup") != -1 ) {
  351. X                for(i=0;i<MAXSYS;i++) {
  352. X                    if(strcmp(sysacc[i].sname,
  353. X                        sysname) == 0)
  354. X                        sysacc[i].okstr++;
  355. X                }
  356. X            }
  357. X            else if(tindex(getfield(4,line,' '),"convers") != -1 ) {
  358. X                for(i=0;i < MAXSYS;i++) {
  359. X                    if(strcmp(sysacc[i].sname,
  360. X                        sysname) == 0)
  361. X                        sysacc[i].okstop++;
  362. X                }
  363. X            }
  364. X        }
  365. X    }
  366. X    fclose(fpin);
  367. X    printf("UUCP ANALYZER:\n");
  368. X    printf("%5sBy system:\n","");
  369. X    for(i=0;i < MAXSYS;i++) {
  370. X    if(strlen(sysacc[i].sname) > 0) {
  371. X        printf("%10s%s\n", "", sysacc[i].sname);
  372. X        hourtmp = sysacc[i].btsent / 60;    /* gives interger min */
  373. X        second = sysacc[i].btsent - ( hourtmp * 60); /* seconds */
  374. X        hour =  hourtmp / 60;    /* gives integer hour */
  375. X        min = hourtmp - ( hour * 60);
  376. X        printf("%15ssent       %10ld bytes %5stime ", "", sysacc[i].bbsent,"");
  377. X        printf("%02ld:%02ld:%02ld", hour, min, second);
  378. X        if (sysacc[i].btsent != 0)
  379. X            printf("    %3d bytes/sec", sysacc[i].bbsent / sysacc[i].btsent);
  380. X        putchar('\n');
  381. X        printf("%15sreceived   %10ld bytes %5stime ","",sysacc[i].brec,"");
  382. X        hourtmp = sysacc[i].btrec / 60;    /* gives interger min */
  383. X        second = sysacc[i].btrec - ( hourtmp * 60); /* seconds */
  384. X        hour =  hourtmp / 60;    /* gives integer hour */
  385. X        min = hourtmp - ( hour * 60);
  386. X        printf("%02ld:%02ld:%02ld", hour, min, second);
  387. X        if (sysacc[i].btrec != 0)
  388. X            printf("    %3d bytes/sec", sysacc[i].brec / sysacc[i].btrec);
  389. X        putchar('\n');
  390. X        printf("%15s# of files %10d sent   %5s %5d received\n",
  391. X            "",sysacc[i].usent, "",sysacc[i].ugot);
  392. X        printf("%15s# of calls %10d suc     %10d fail   %10d lock\n",
  393. X            "", sysacc[i].suc, sysacc[i].fail, sysacc[i].lock);
  394. X        printf("%15sConversations OK %5d (startup)   %5d (completed)\n",
  395. X            "", sysacc[i].okstr, sysacc[i].okstop);
  396. X        /* next do total */
  397. X        hour = sysacc[i].bbsent - sysacc[i].brec;
  398. X        if(hour < 0) {    /* means we rec more */
  399. X            hour *= -1;
  400. X            printf("%15sreceived %ld bytes more than sent\n",
  401. X                "", hour);
  402. X        }
  403. X        else if(hour > 0)    /* means we sent more */
  404. X            printf("%15ssent %ld bytes more that received\n",
  405. X                "", hour);
  406. X        else
  407. X            printf("%15ssent the same amount as received\n","");
  408. X        hourtmp = (sysacc[i].btrec + sysacc[i].btsent)  / 60;
  409. X        second = (sysacc[i].btrec + sysacc[i].btsent) 
  410. X                - ( hourtmp * 60); /* seconds */
  411. X        hour =  hourtmp / 60;    /* gives integer hour */
  412. X        min = hourtmp - ( hour * 60);
  413. X        printf("%15stotal connect time %02ld:%02ld:%02ld\n",
  414. X            "", hour, min, second);
  415. X    }
  416. X    }
  417. X    printf("\n%5sBy user:\n", "");
  418. X    treeprint(usage);
  419. X    printf("\n%5sBy commands:\n", "");
  420. X    trsort();
  421. X    tcallpr(cmd);
  422. X    printf("\n%5sBy day:\n","");
  423. X    for(i = 1; i <= 12; i++)
  424. X        for(j = 1; j <= 31; j++) {
  425. X            if(dayacc[i][j].used) {
  426. X                hourtmp = dayacc[i][j].trecv / 60;
  427. X                second = dayacc[i][j].trecv - ( hourtmp * 60);
  428. X                hour =  hourtmp / 60;    /* gives integer hour */
  429. X                min = hourtmp - ( hour * 60);
  430. X                printf("%5s%2d/%02d ", "", i,j);
  431. X                printf("received %8ld bytes in ", dayacc[i][j].recv);
  432. X                printf("%02ld:%02ld:%02ld/sent %8ld bytes in ",
  433. X                    hour,min,second, dayacc[i][j].sent);
  434. X                hourtmp = dayacc[i][j].tsent / 60;
  435. X                second = dayacc[i][j].tsent - ( hourtmp * 60);
  436. X                hour =  hourtmp / 60;    /* gives integer hour */
  437. X                min = hourtmp - ( hour * 60);
  438. X                printf("%02ld:%02ld:%02ld\n", hour,min,second);
  439. X            }
  440. X        }
  441. X    exit(0);
  442. X}
  443. X
  444. Xerror(s)
  445. Xchar *s;
  446. X{
  447. X    void perror();
  448. X
  449. X    perror(s);
  450. X    exit(1);
  451. X}
  452. X
  453. Xtindex(s,t)
  454. Xchar s[], t[];
  455. X{
  456. X    register int j,k,i;
  457. X
  458. X    if (s == NULL || t == NULL) {
  459. X    error("tindex: pointer is null");
  460. X    }
  461. X    for(i=0;s[i] != '\0'; i++) {
  462. X        for(j=i,k=0;t[k] != '\0' && s[j]== t[k]; j++, k++)
  463. X            ;
  464. X        if(t[k] == '\0')
  465. X            return(i);
  466. X    }
  467. X    return(-1);
  468. X}
  469. Xchar *strsave(s)    /* save string s somewhere */
  470. Xchar *s;
  471. X{
  472. X    char *p;
  473. X    char *strcpy();
  474. X
  475. X    if((p = malloc( (unsigned) (strlen(s)+1) )) == NULL) {
  476. X        error("strsave: out of mem");
  477. X    }
  478. X    return strcpy(p,s);
  479. X}
  480. Xstruct users *tree(p,w)
  481. Xstruct users *p;
  482. Xchar *w;
  483. X{
  484. X    if(p == NULL) { /* new word */
  485. X        p = (struct users *) malloc (sizeof(struct users));
  486. X        if (p == NULL) {
  487. X        error("tree: out of memory");
  488. X        }
  489. X        p->name = strsave(w);
  490. X        p->bsent = byt;
  491. X        p->utim = tim;
  492. X        p->nsent = 1;
  493. X        p->nuser = NULL;
  494. X    }
  495. X    else if(strcmp(w,p->name) == 0) {
  496. X        p->bsent += byt;
  497. X        p->utim += tim;
  498. X        p->nsent++;
  499. X    }
  500. X    else {
  501. X        p->nuser = tree(p->nuser,w);
  502. X    }
  503. X    return(p);
  504. X}
  505. Xstruct call *tcall(p,w)
  506. Xstruct call *p;
  507. Xchar *w;
  508. X{
  509. X    if(p == NULL) { /* new cmd */
  510. X        p = (struct call *) malloc (sizeof(struct call));
  511. X        if(p == NULL)
  512. X            error("tcall out of Mem");
  513. X        p->ncall = NULL;
  514. X        p->cname = strsave(w);
  515. X        p->times = 1;
  516. X        cmdcount++;
  517. X    }
  518. X    else if(strcmp(w,p->cname) == 0) {
  519. X        p->times++;
  520. X    }
  521. X    else {
  522. X        p->ncall = tcall(p->ncall,w);
  523. X    }
  524. X    return(p);
  525. X}
  526. Xtreeprint(p)
  527. Xstruct users *p;
  528. X{
  529. X    if(p != NULL) {
  530. X        printf("%10s%10s ", "", p->name);
  531. X        printf("sent %4ld files & %10ld bytes ", p->nsent, p->bsent);
  532. X        hourtmp = p->utim /60;
  533. X        second = p->utim - ( hourtmp * 60 );
  534. X        hour = hourtmp / 60;
  535. X        min = hourtmp - (hour * 60);
  536. X        printf("%02ld:%02ld:%02ld\n", hour,min,second);
  537. X        treeprint(p->nuser);
  538. X    }
  539. X}
  540. Xtcallpr(p)
  541. Xstruct call *p;
  542. X{
  543. X    if(p != NULL ) {
  544. X        printf("%10d %s\n", p->times, p->cname);
  545. X        tcallpr(p->ncall);
  546. X    }
  547. X}
  548. Xtrsort()
  549. X{
  550. X    struct call *q;
  551. X    struct call *p;
  552. X    register int i, sw, n,m;
  553. X    char *c;
  554. X    char *d;
  555. X
  556. Xloop:
  557. X    p = cmd;
  558. X    sw = 0;
  559. X    for(i=0;i< cmdcount-1; i++) {
  560. X        q = p->ncall;
  561. X        if(p->times < q->times) { /* switch */
  562. X            c = p->cname;
  563. X            n = p->times;
  564. X            d = q->cname;
  565. X            m = q->times;
  566. X            p->cname = d;
  567. X            p->times = m;
  568. X            q->cname = c;
  569. X            q->times = n;
  570. X            sw = 1;
  571. X        }
  572. X        p = p->ncall;
  573. X    }
  574. X    if(sw)
  575. X        goto loop;
  576. X}
  577. X#define NULLP ""
  578. Xchar *
  579. Xgetfield(field,buffer,separator)
  580. Xchar separator;
  581. Xchar buffer[];
  582. Xint field;
  583. X{
  584. X    register int i;
  585. X    char *bp, *p, buff[512];
  586. X    int sht;
  587. X
  588. X    sht = 0;
  589. X    strcpy(buff,buffer);
  590. X    p = &buff[0];
  591. X    i = 0;
  592. X    if((*p == separator) && (field != 0)) {
  593. X        field--;
  594. X        sht = 1;
  595. X    }
  596. X    while( i != field) {
  597. X        for(++p; *p != separator; p++) {
  598. X            if (*p == '\0') {
  599. X                return(NULLP);
  600. X            }
  601. X        }
  602. X        i++;
  603. X    }
  604. X    if(sht)
  605. X        field += 1;
  606. X    if(field != 0) p++;
  607. X    bp =p;
  608. X    for (; *p != separator; p++)
  609. X        if(*p == '\0')
  610. X            return(bp);
  611. X    *p = '\0';
  612. X    return(bp);
  613. X}
  614. X
  615. Xtellem()
  616. X{
  617. X    fprintf(stderr, "usage: %s [-l logfile] [-s syslog]\n",
  618. X        Cmdname);
  619. X    exit(1);
  620. X}
  621. !Funky!Stuff!
  622.  
  623. echo 'x - Makefile'
  624. sed -e 's/^X//' > Makefile << '!Funky!Stuff!'
  625. XSHELL = /bin/sh
  626. XI = /usr/include
  627. XDEST = /usr/hippo/gam/bin
  628. X
  629. Xuucpanz: uucpanz.c    uucpanz.h $I/stdio.h $I/ctype.h 
  630. X    $(CC) $(CFLAGS) -o uucpanz uucpanz.c
  631. X
  632. Xinstall: uucpanz
  633. X    cp uucpanz $(DEST)
  634. X
  635. Xclean:
  636. Xclobber: clean
  637. X    -rm -f uucpanz
  638. X
  639. !Funky!Stuff!
  640.  
  641. exit
  642.