Files
discount/echo.c
T
David Parsons dd62ce7675 Xcode for Macos 10.5 sucks. If you're running /bin/sh
here, `echo -n` *does not work* from inside it.  So I
will write my own version of echo and use that for test
output.
2008-05-23 21:36:15 -07:00

23 lines
312 B
C

#include <stdio.h>
#include <string.h>
main(argc, argv)
char **argv;
{
int nl = 1;
int i;
if ( (argc > 1) && (strcmp(argv[1], "-n") == 0) ) {
++argv;
--argc;
nl = 0;
}
for ( i=1; i < argc; i++ ) {
if ( i > 1 ) putchar(' ');
fputs(argv[i], stdout);
}
if (nl) putchar('\n');
}