home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / apple2 / 36 < prev    next >
Encoding:
Internet Message Format  |  1990-12-02  |  1.1 KB

  1. Path: wuarchive!usc!rutgers!aramis.rutgers.edu!paul.rutgers.edu!yoko.rutgers.edu!jac
  2. From: jac@yoko.rutgers.edu (Jonathan A. Chandross)
  3. Newsgroups: comp.sources.apple2
  4. Subject: v001SRC012:  Echo Command Line Arguments
  5. Message-ID: <Dec.1.16.45.32.1990.24615@yoko.rutgers.edu>
  6. Date: 1 Dec 90 21:45:33 GMT
  7. Organization: Rutgers Univ., New Brunswick, N.J.
  8. Lines: 49
  9. Approved: jac@paul.rutgers.edu
  10.  
  11.  
  12. Submitted-by: NONE
  13. Posting-number: Volume 1, Source:12
  14. Archive-name: util/echo
  15. Architecture: ANY_2
  16. Version-number: 1.00
  17.  
  18. This C program echoes its command line arguments.  Just like the Unix
  19. version.
  20.  
  21. Enjoy.
  22.  
  23. =echo.c
  24. -
  25. -/*
  26. - *
  27. - * echo.c
  28. - *
  29. - * Print out the command line arguments one after the other.  Output
  30. - * is terminated with a newline.
  31. - *
  32. - * Usage:
  33. - *    echo [arg_1] [arg_2] [arg_3] [...]
  34. - *
  35. - *    If no arguments are specified echo does nothing.
  36. - *
  37. - * Contributed Anonymously.  Written: November 1983
  38. - *
  39. - * Version 1.00
  40. - *
  41. - */
  42. -
  43. -#include "stdio.h"
  44. -
  45. -#define BLANK ' '
  46. -#define NL    '\n'
  47. -
  48. -main( argc, argv )
  49. -int argc ;
  50. -char *argv[] ;
  51. -{
  52. -    int i ;
  53. -
  54. -    for( i=1 ; i < argc ; i++ )
  55. -        printf("%s%c", argv[i], (i<argc-1) ? BLANK : NL) ;
  56. -
  57. -}
  58. -
  59. + END OF ARCHIVE
  60.