dhilst

cat that print name before lines, just bullshit

#include <stdio.h>
#include <errno.h>

int
main (int argc, char **argv)
{
FILE *fp;
char *line, buf[99];

if (argc < 2)
return -1;

argv++;
for (; argc > 1; argc--, argv++)
{
if (! (fp = fopen (*argv, "r")))
error (1,errno);

while ((line = fgets(buf, 99, fp)) != NULL)
printf ("%s: %s", *argv, line);
}
return 0;
}