]>
git.ipfire.org Git - thirdparty/bash.git/blob - examples/loadables/cat.c
4 * no options - the way cat was intended
17 extern char *strerror ();
18 extern char **make_builtin_argv ();
27 while (n
= read(fd
, buf
, sizeof (buf
))) {
31 write(2, "cat: write error: ", 18);
33 write(2, s
, strlen(s
));
51 for (i
= r
= 1; i
< argc
; i
++) {
52 if (argv
[i
][0] == '-' && argv
[i
][1] == '\0')
55 fd
= open(argv
[i
], O_RDONLY
, 0666);
58 write(2, "cat: cannot open ", 17);
59 write(2, argv
[i
], strlen(argv
[i
]));
61 write(2, s
, strlen(s
));
79 v
= make_builtin_argv(list
, &c
);
87 "Read each FILE and display it on the standard output. If any",
88 "FILE is `-' or if no FILE argument is given, the standard input",
93 struct builtin cat_struct
= {