home *** CD-ROM | disk | FTP | other *** search
- Path: wuarchive!usc!rutgers!aramis.rutgers.edu!paul.rutgers.edu!yoko.rutgers.edu!jac
- From: jac@yoko.rutgers.edu (Jonathan A. Chandross)
- Newsgroups: comp.sources.apple2
- Subject: v001SRC012: Echo Command Line Arguments
- Message-ID: <Dec.1.16.45.32.1990.24615@yoko.rutgers.edu>
- Date: 1 Dec 90 21:45:33 GMT
- Organization: Rutgers Univ., New Brunswick, N.J.
- Lines: 49
- Approved: jac@paul.rutgers.edu
-
-
- Submitted-by: NONE
- Posting-number: Volume 1, Source:12
- Archive-name: util/echo
- Architecture: ANY_2
- Version-number: 1.00
-
- This C program echoes its command line arguments. Just like the Unix
- version.
-
- Enjoy.
-
- =echo.c
- -
- -/*
- - *
- - * echo.c
- - *
- - * Print out the command line arguments one after the other. Output
- - * is terminated with a newline.
- - *
- - * Usage:
- - * echo [arg_1] [arg_2] [arg_3] [...]
- - *
- - * If no arguments are specified echo does nothing.
- - *
- - * Contributed Anonymously. Written: November 1983
- - *
- - * Version 1.00
- - *
- - */
- -
- -#include "stdio.h"
- -
- -#define BLANK ' '
- -#define NL '\n'
- -
- -main( argc, argv )
- -int argc ;
- -char *argv[] ;
- -{
- - int i ;
- -
- - for( i=1 ; i < argc ; i++ )
- - printf("%s%c", argv[i], (i<argc-1) ? BLANK : NL) ;
- -
- -}
- -
- + END OF ARCHIVE
-