#include <stdio.h>

main(argc,argv)	/* output listing of file with line number */

char *argv[];
{
 FILE *fd;
 int i,chars,j;
 char line[133];

	fd=fopen(argv[1],"r");
	if(fd<1){
	  fprintf(stderr,"cl --> can't find %s\n",argv[1]);exit(0);}
		else{
			fprintf(stdout,"\n");
			i=1;
			while(getlin(fd,line) != EOF){
			   fprintf(stdout,"%3d: ",i);
			   fprintf(stdout,"%s\n",line);
				if((i%60)==0)
					fprintf(stdout,"\014");
				++i;
					}
			}
if (ftty(stdout) != 1)
   fspool(stdout);
exit(0);
}


getlin(fd,s)
FILE *fd;
char *s;
{
	int c,i;
	for (i=0 ; (c=getc(fd))!=EOF && c!='\n'; ++i)
	   s[i] = c;
	s[i] = '\0';
	return(c);
}
