* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
"@(#) Copyright (c) 1980 Regents of the University of California.\n\
static char sccsid
[] = "@(#)head.c 5.1 (Berkeley) %G%";
* head - give the first few lines of a stream or of each of a set of files
* Bill Joy UCB August 24, 1977
while (argc
> 0 && argv
[0][0] == '-') {
linecnt
= getnum(argv
[0] + 1);
if (freopen(argv
[0], "r", stdin
) == NULL
) {
printf("==> %s <==\n", name
);
while (cnt
> 0 && fgets(lbuf
, sizeof lbuf
, stdin
) != 0) {
for (i
= 0; *cp
>= '0' && *cp
<= '9'; cp
++)
fprintf(stderr
, "Badly formed number\n");