home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume25 / finger / part01 / myecho.c < prev    next >
C/C++ Source or Header  |  1992-04-03  |  909b  |  45 lines

  1. /*
  2.  * myecho.c -- avoid Sys V compatible echo (interprets \n) for make-version
  3.  *
  4.  * Copyright (C) 1988, 1990  Philip L. Budne
  5.  *
  6.  * This file is part of "Phil's Finger Program".
  7.  *
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 1, or (at your option)
  11.  * any later version.
  12.  *
  13.  */
  14.  
  15. # ifndef lint
  16. static char *rcsid = "$Id: myecho.c,v 3.0 90/07/06 13:11:21 budd Rel $";
  17. # endif /* lint not defined */
  18.  
  19. # include <stdio.h>
  20. # include "finger.h"
  21.  
  22. main( c, v )
  23.     int c;
  24.     char **v;
  25. {
  26.     int i, newline;
  27.     c--;
  28.     v++;
  29.  
  30.     newline = 1;
  31.     if( strcmp( *v, "-n" ) == 0 ) {
  32.     c--;
  33.     v++;
  34.     newline = 0;
  35.     }
  36.     while( c-- > 0 ) {
  37.     if( i++ > 0 )
  38.         putchar(' ');
  39.     printf("%s", *v++ );
  40.     } /* for */
  41.     if( newline )
  42.     putchar('\n');
  43.     exit( 0 );
  44. } /* main */
  45.