don't redeclare malloc and realloc
[unix-history] / usr / src / local / tac / tac.1
CommitLineData
2899ecfc 1.\" @(#)tac.1 1.3 %G%
b4d9d38e
JL
2.\"
3.TH TAC 1 ""
4.SH NAME
5tac \- concatenate and print files in reverse
6.SH SYNOPSIS
7.B tac
8[
9.B \-string
10] [
11.B +string
ffcf70e9 12] [ file ... ]
b4d9d38e
JL
13.SH DESCRIPTION
14.I Tac
15reads each
16.I file
17in sequence
18and writes it on the standard output, reversed by the file segments
19delimited by
20.I string.
21.I \-string
22specifies segments bounded on the left by
23.I string,
24while
25.I +string
26specifies right-bounded segments.
27The default is
28.I +\en
29(print lines in reverse order).
ffcf70e9
JL
30If no input
31.I file
32is given, or if the argument `-'
33is encountered,
34.I tac
35reads from the standard input. Note that in this case
36.I tac
37stores the entire standard input in a temporary
38file before it outputs anything, so for large input it is slow.
b4d9d38e
JL
39.SH EXAMPLES
40.RS
41tac '-\e
42.br
2899ecfc 43From\ ' /var/mail/$USER
b4d9d38e
JL
44.RE
45prints out one's mail messages, most recent first.
46.PP
47.RS
48tac file
49.RE
50prints the file in reverse, line by line, and:
51.PP
52.RS
2899ecfc 53tac /var/log/messages | egrep 'hp.*hard'
b4d9d38e 54.RE
ffcf70e9 55prints out the hard errors on MASSBUS disk drives, most recent first.
b4d9d38e
JL
56.SH SEE ALSO
57cat(1), rev(1), tail(1), tmail(1)
58.SH BUGS
59.I Tac
ffcf70e9
JL
60doesn't handle multiple argument files exactly right, and it's
61also unclear in which order they should be processed.
b4d9d38e 62.br
ffcf70e9
JL
63If invoked as `tac < file',
64.I tac
65uses a temp file but it doesn't have to.