Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | .\" Copyright (c) 1989, 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" This code is derived from software contributed to Berkeley by | |
5 | .\" Adam S. Moskowitz and the Institute of Electrical and Electronics | |
6 | .\" Engineers, Inc. | |
7 | .\" | |
8 | .\" Redistribution and use in source and binary forms, with or without | |
9 | .\" modification, are permitted provided that the following conditions | |
10 | .\" are met: | |
11 | .\" 1. Redistributions of source code must retain the above copyright | |
12 | .\" notice, this list of conditions and the following disclaimer. | |
13 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
14 | .\" notice, this list of conditions and the following disclaimer in the | |
15 | .\" documentation and/or other materials provided with the distribution. | |
16 | .\" 3. All advertising materials mentioning features or use of this software | |
17 | .\" must display the following acknowledgement: | |
18 | .\" This product includes software developed by the University of | |
19 | .\" California, Berkeley and its contributors. | |
20 | .\" 4. Neither the name of the University nor the names of its contributors | |
21 | .\" may be used to endorse or promote products derived from this software | |
22 | .\" without specific prior written permission. | |
23 | .\" | |
24 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
25 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
26 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
27 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
28 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
29 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
30 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
31 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
32 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
34 | .\" SUCH DAMAGE. | |
35 | .\" | |
36 | .\" @(#)paste.1 5.6 (Berkeley) 7/27/91 | |
37 | .\" | |
38 | .Dd July 27, 1991 | |
39 | .Dt PASTE 1 | |
40 | .Os | |
41 | .Sh NAME | |
42 | .Nm paste | |
43 | .Nd merge corresponding or subsequent lines of files | |
44 | .Sh SYNOPSIS | |
45 | .Nm paste | |
46 | .Op Fl s | |
47 | .Op Fl d Ar list | |
48 | .Ar file ... | |
49 | .Sh DESCRIPTION | |
50 | The | |
51 | .Nm paste | |
52 | utility concatenates the corresponding lines of the given input files, | |
53 | replacing all but the last file's newline characters with a single tab | |
54 | character, and writes the resulting lines to standard output. | |
55 | If end-of-file is reached on an input file while other input files | |
56 | still contain data, the file is treated as if it were an endless source | |
57 | of empty lines. | |
58 | .Pp | |
59 | The options are as follows: | |
60 | .Bl -tag -width Fl | |
61 | .It Fl d Ar list | |
62 | Use one or more of the provided characters to replace the newline | |
63 | characters instead of the default tab. | |
64 | The characters in | |
65 | .Ar list | |
66 | are used circularly, i.e., when | |
67 | .Ar list | |
68 | is exhausted the first character from | |
69 | .Ar list | |
70 | is reused. | |
71 | This continues until a line from the last input file (in default operation) | |
72 | or the last line in each file (using the -s option) is displayed, at which | |
73 | time | |
74 | .Nm paste | |
75 | begins selecting characters from the beginning of | |
76 | .Ar list | |
77 | again. | |
78 | .Pp | |
79 | The following special characters can also be used in list: | |
80 | .Pp | |
81 | .Bl -tag -width flag -compact | |
82 | .It Li \en | |
83 | newline character | |
84 | .It Li \et | |
85 | tab character | |
86 | .It Li \e\e | |
87 | backslash character | |
88 | .It Li \e0 | |
89 | Empty string (not a null character). | |
90 | .El | |
91 | .Pp | |
92 | Any other character preceded by a backslash is equivalent to the | |
93 | character itself. | |
94 | .It Fl s | |
95 | Concatenate all of the lines of each separate input file in command line | |
96 | order. | |
97 | The newline character of every line except the last line in each input | |
98 | file is replaced with the tab character, unless otherwise specified by | |
99 | the -d option. | |
100 | .El | |
101 | .Pp | |
102 | If | |
103 | .Ql Fl | |
104 | is specified for one or more of the input files, the standard | |
105 | input is used; standard input is read one line at a time, circularly, | |
106 | for each instance of | |
107 | .Ql Fl . | |
108 | .Pp | |
109 | The | |
110 | .Nm paste | |
111 | utility exits 0 on success, and >0 if an error occurs. | |
112 | .Sh SEE ALSO | |
113 | .Xr cut 1 | |
114 | .Sh STANDARDS | |
115 | The | |
116 | .Nm paste | |
117 | utility is expected to be | |
118 | .St -p1003.2 | |
119 | compatible. |