1 /*- 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * %sccs.include.noredist.c% 9 */ 10 11 #ifndef lint 12 char copyright[] = 13 "@(#) Copyright (c) 1990 The Regents of the University of California.\n\ 14 All rights reserved.\n"; 15 #endif /* not lint */ 16 17 #ifndef lint 18 static char sccsid[] = "@(#)cat.c 7.1 (Berkeley) 04/24/90"; 19 #endif /* not lint */ 20 21 main() 22 { 23 int c, i; 24 char buf[50]; 25 26 do { 27 printf("File: "); 28 gets(buf); 29 i = open(buf, 0); 30 } while (i <= 0); 31 32 while ((c = getc(i)) > 0) 33 putchar(c); 34 exit(0); 35 } 36