Blob


1 .TH CAT 1
2 .SH NAME
3 cat, read, nobs \- catenate files
4 .SH SYNOPSIS
5 .B cat
6 [
7 .I file ...
8 ]
9 .br
10 .B read
11 [
12 .B -m
13 ] [
14 .B -n
15 .I nline
16 ] [
17 .I file ...
18 ]
19 .br
20 .B nobs
21 [
22 .I file ...
23 ]
24 .SH DESCRIPTION
25 .I Cat
26 reads each
27 .I file
28 in sequence and writes it on the standard output.
29 Thus
30 .IP
31 .L
32 cat file
33 .LP
34 prints a file and
35 .IP
36 .L
37 cat file1 file2 >file3
38 .LP
39 concatenates the first two files and places the result
40 on the third.
41 .PP
42 If no
43 .I file
44 is given,
45 .I cat
46 reads from the standard input.
47 Output is buffered in blocks matching the input.
48 .PP
49 .I Read
50 copies to standard output exactly one line from the named
51 .IR file ,
52 default standard input.
53 It is useful in interactive
54 .MR rc (1)
55 scripts.
56 .PP
57 The
58 .B -m
59 flag causes it to continue reading and writing multiple lines until end of file;
60 .B -n
61 causes it to read no more than
62 .I nline
63 lines.
64 .PP
65 .I Read
66 always executes a single
67 .B write
68 for each line of input, which can be helpful when
69 preparing input to programs that expect line-at-a-time data.
70 It never reads any more data from the input than it prints to the output.
71 .PP
72 .I Nobs
73 copies the named files to
74 standard output except that it removes all backspace
75 characters and the characters that precede them.
76 It is useful to use as
77 .B $PAGER
78 with the Unix version of
79 .MR man (1)
80 when run inside a
81 .I win
82 (see
83 .MR acme (1) )
84 window.
85 .SH SOURCE
86 .B \*9/src/cmd/cat.c
87 .br
88 .B \*9/src/cmd/read.c
89 .br
90 .B \*9/bin/nobs
91 .SH SEE ALSO
92 .MR cp (1)
93 .SH DIAGNOSTICS
94 .I Read
95 exits with status
96 .B eof
97 on end of file or, in the
98 .B -n
99 case, if it doesn't read
100 .I nlines
101 lines.
102 .SH BUGS
103 Beware of
104 .L "cat a b >a"
105 and
106 .LR "cat a b >b" ,
107 which
108 destroy input files before reading them.