[comp.sources.apple2] v001SRC012: Echo Command Line Arguments

jac@yoko.rutgers.edu (Jonathan A. Chandross) (12/02/90)

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