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