#include
#include
#include
#include
#include
int main(int argc, char *argv[])
{
char buf[BUFSIZ];
int f1, n;
if(argc == 1)
while((n = read(0, buf, sizeof buf)) > 0)
write(1, buf, n);
else
{
while(--argc>0)
if( ( f1=open(*++argv, O_RDONLY, 0) ) == -1)
printf("cat: can't open file \"%s\"!\n", *argv);
else
while( ( n = read(f1, buf, BUFSIZ) ) >0)
write(1, buf, n);
}
return 0;
}
阅读(1149) | 评论(0) | 转发(0) |