Commit | Line | Data |
---|---|---|
8ae0e4b4 | 1 | /* |
0880b18e | 2 | * Copyright (c) 1982, 1986 Regents of the University of California. |
8ae0e4b4 KM |
3 | * All rights reserved. The Berkeley software License Agreement |
4 | * specifies the terms and conditions for redistribution. | |
5 | * | |
0880b18e | 6 | * @(#)cat.c 7.1 (Berkeley) %G% |
8ae0e4b4 | 7 | */ |
68d53a2f BJ |
8 | |
9 | main() | |
10 | { | |
11 | int c, i; | |
12 | char buf[50]; | |
13 | ||
14 | do { | |
15 | printf("File: "); | |
16 | gets(buf); | |
17 | i = open(buf, 0); | |
18 | } while (i <= 0); | |
19 | ||
20 | while ((c = getc(i)) > 0) | |
21 | putchar(c); | |
22 | exit(0); | |
23 | } |