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