1 .\" Copyright (c) 1989, 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" This code is derived from software contributed to Berkeley by
5 .\" Adam S. Moskowitz and the Institute of Electrical and Electronics
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
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. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)paste.1 8.1 (Berkeley) 6/6/93
33 .\" $FreeBSD: head/usr.bin/paste/paste.1 216370 2010-12-11 08:32:16Z joel $
40 .Nd merge corresponding or subsequent lines of files
49 utility concatenates the corresponding lines of the given input files,
50 replacing all but the last file's newline characters with a single tab
51 character, and writes the resulting lines to standard output.
52 If end-of-file is reached on an input file while other input files
53 still contain data, the file is treated as if it were an endless source
56 The options are as follows:
59 Use one or more of the provided characters to replace the newline
60 characters instead of the default tab.
63 are used circularly, i.e., when
65 is exhausted the first character from
68 This continues until a line from the last input file (in default operation)
69 or the last line in each file (using the
71 option) is displayed, at which
74 begins selecting characters from the beginning of
78 The following special characters can also be used in list:
80 .Bl -tag -width flag -compact
88 Empty string (not a null character).
91 Any other character preceded by a backslash is equivalent to the
94 Concatenate all of the lines of each separate input file in command line
96 The newline character of every line except the last line in each input
97 file is replaced with the tab character, unless otherwise specified by
105 is specified for one or more of the input files, the standard
106 input is used; standard input is read one line at a time, circularly,
114 environment variables affect the execution of
121 List the files in the current directory in three columns:
123 .Dl "ls | paste - - -"
125 Combine pairs of lines from a file into single lines:
127 .Dl "paste -s -d '\et\en' myfile"
129 Number the lines in a file, similar to
132 .Dl "sed = myfile | paste -s -d '\et\en' - -"
134 Create a colon-separated list of directories named
139 environment variable:
141 .Dl "find / -name bin -type d | paste -s -d : -"
148 utility is expected to be