Echo command.
This commit is contained in:
parent
306c16b95a
commit
37a3d2acd4
|
@ -0,0 +1,28 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
/*
|
||||||
|
* Echo [-n] ...
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
int i;
|
||||||
|
int space = 0;
|
||||||
|
int n = 0;
|
||||||
|
|
||||||
|
for (i = 1; i < argc; ++i) {
|
||||||
|
|
||||||
|
char *cp = argv[i];
|
||||||
|
if (cp[0] == '-' && cp[1] == 'n' && cp[2] == 0) {
|
||||||
|
n = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (space) fputc(' ', stdout);
|
||||||
|
fputs(cp, stdout);
|
||||||
|
space = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (space && n) fputc(' ', stdout);
|
||||||
|
if (!n) fputc('\n', stdout);
|
||||||
|
return 0;
|
||||||
|
}
|
5
makefile
5
makefile
|
@ -28,7 +28,7 @@ LIBS = \
|
||||||
|
|
||||||
# LDFLAGS = -d -c 'MPS ' -t MPST
|
# LDFLAGS = -d -c 'MPS ' -t MPST
|
||||||
|
|
||||||
all: Help GetEnv Duplicate SetFile OverlayIIgs ListRez ListRezIIgs MakeEnums ReadGlobal Parameters
|
all: Help GetEnv Duplicate SetFile OverlayIIgs ListRez ListRezIIgs MakeEnums ReadGlobal Parameters Echo
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
|
@ -71,6 +71,9 @@ ReadGlobal: ReadGlobal.c.o libc/libc
|
||||||
Parameters: Parameters.c.o
|
Parameters: Parameters.c.o
|
||||||
$(MPW) Link $(LDFLAGS) -o $@ $^ $(LIBS)
|
$(MPW) Link $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
|
Echo: Echo.c.o
|
||||||
|
$(MPW) Link $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
#SetFile.c : SetFile.rl
|
#SetFile.c : SetFile.rl
|
||||||
# ragel -G2 -p -m -o $@ $<
|
# ragel -G2 -p -m -o $@ $<
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue