Commit | Line | Data |
---|---|---|
b5dc1377 | 1 | .\" Copyright (c) 1989, 1990 The Regents of the University of California. |
6ac1351a | 2 | .\" All rights reserved. |
b5dc1377 | 3 | .\" |
6ac1351a | 4 | .\" This code is derived from software contributed to Berkeley by |
ae122740 KB |
5 | .\" Adam S. Moskowitz and the Institute of Electrical and Electronics |
6 | .\" Engineers, Inc. | |
6ac1351a | 7 | .\" |
ae122740 | 8 | .\" %sccs.include.redist.roff% |
6ac1351a | 9 | .\" |
263cc8fc | 10 | .\" @(#)paste.1 5.6 (Berkeley) %G% |
6ac1351a | 11 | .\" |
b5dc1377 CL |
12 | .Dd |
13 | .Dt PASTE 1 | |
ee9b0a0a | 14 | .Os |
b5dc1377 CL |
15 | .Sh NAME |
16 | .Nm paste | |
17 | .Nd merge corresponding or subsequent lines of files | |
18 | .Sh SYNOPSIS | |
19 | .Nm paste | |
20 | .Op Fl s | |
21 | .Op Fl d Ar list | |
22 | .Ar file ... | |
23 | .Sh DESCRIPTION | |
6ac1351a | 24 | The |
b5dc1377 | 25 | .Nm paste |
6ac1351a KB |
26 | utility concatenates the corresponding lines of the given input files, |
27 | replacing all but the last file's newline characters with a single tab | |
28 | character, and writes the resulting lines to standard output. | |
29 | If end-of-file is reached on an input file while other input files | |
30 | still contain data, the file is treated as if it were an endless source | |
31 | of empty lines. | |
b5dc1377 | 32 | .Pp |
6ac1351a | 33 | The options are as follows: |
263cc8fc CL |
34 | .Bl -tag -width Fl |
35 | .It Fl d Ar list | |
6ac1351a KB |
36 | Use one or more of the provided characters to replace the newline |
37 | characters instead of the default tab. | |
38 | The characters in | |
b5dc1377 | 39 | .Ar list |
6ac1351a | 40 | are used circularly, i.e., when |
b5dc1377 | 41 | .Ar list |
6ac1351a | 42 | is exhausted the first character from |
b5dc1377 | 43 | .Ar list |
6ac1351a KB |
44 | is reused. |
45 | This continues until a line from the last input file (in default operation) | |
46 | or the last line in each file (using the -s option) is displayed, at which | |
47 | time | |
b5dc1377 | 48 | .Nm paste |
6ac1351a | 49 | begins selecting characters from the beginning of |
b5dc1377 | 50 | .Ar list |
6ac1351a | 51 | again. |
b5dc1377 | 52 | .Pp |
6ac1351a | 53 | The following special characters can also be used in list: |
263cc8fc CL |
54 | .Pp |
55 | .Bl -tag -width flag -compact | |
56 | .It Li \en | |
6ac1351a | 57 | newline character |
263cc8fc | 58 | .It Li \et |
6ac1351a | 59 | tab character |
263cc8fc | 60 | .It Li \e\e |
6ac1351a | 61 | backslash character |
263cc8fc | 62 | .It Li \e0 |
6ac1351a | 63 | Empty string (not a null character). |
263cc8fc | 64 | .El |
b5dc1377 | 65 | .Pp |
6ac1351a KB |
66 | Any other character preceded by a backslash is equivalent to the |
67 | character itself. | |
263cc8fc | 68 | .It Fl s |
6ac1351a KB |
69 | Concatenate all of the lines of each separate input file in command line |
70 | order. | |
71 | The newline character of every line except the last line in each input | |
72 | file is replaced with the tab character, unless otherwise specified by | |
73 | the -d option. | |
263cc8fc | 74 | .El |
b5dc1377 | 75 | .Pp |
263cc8fc CL |
76 | If |
77 | .Ql Fl | |
78 | is specified for one or more of the input files, the standard | |
6ac1351a | 79 | input is used; standard input is read one line at a time, circularly, |
263cc8fc CL |
80 | for each instance of |
81 | .Ql Fl . | |
b5dc1377 | 82 | .Pp |
6ac1351a | 83 | The |
b5dc1377 | 84 | .Nm paste |
6ac1351a | 85 | utility exits 0 on success, and >0 if an error occurs. |
b5dc1377 CL |
86 | .Sh SEE ALSO |
87 | .Xr cut 1 | |
88 | .Sh STANDARDS | |
6ac1351a | 89 | The |
b5dc1377 | 90 | .Nm paste |
263cc8fc CL |
91 | utility is expected to be |
92 | .St -p1003.2 | |
93 | compatible. |