xref: /netbsd-src/usr.bin/paste/paste.1 (revision 667b1ee949a1b82f2bbaf770b7a015f660d263c5)
1*667b1ee9Swiz.\"	$NetBSD: paste.1,v 1.9 2013/04/07 17:43:01 wiz Exp $
25445d018Stls.\"
35445d018Stls.\" Copyright (c) 1989, 1990, 1993
45445d018Stls.\"	The Regents of the University of California.  All rights reserved.
561f28255Scgd.\"
661f28255Scgd.\" This code is derived from software contributed to Berkeley by
761f28255Scgd.\" Adam S. Moskowitz and the Institute of Electrical and Electronics
861f28255Scgd.\" Engineers, Inc.
961f28255Scgd.\"
1061f28255Scgd.\" Redistribution and use in source and binary forms, with or without
1161f28255Scgd.\" modification, are permitted provided that the following conditions
1261f28255Scgd.\" are met:
1361f28255Scgd.\" 1. Redistributions of source code must retain the above copyright
1461f28255Scgd.\"    notice, this list of conditions and the following disclaimer.
1561f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright
1661f28255Scgd.\"    notice, this list of conditions and the following disclaimer in the
1761f28255Scgd.\"    documentation and/or other materials provided with the distribution.
1889aaa1bbSagc.\" 3. Neither the name of the University nor the names of its contributors
1961f28255Scgd.\"    may be used to endorse or promote products derived from this software
2061f28255Scgd.\"    without specific prior written permission.
2161f28255Scgd.\"
2261f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2361f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2461f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2561f28255Scgd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2661f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2761f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2861f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2961f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3061f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3161f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3261f28255Scgd.\" SUCH DAMAGE.
3361f28255Scgd.\"
345445d018Stls.\"	from: @(#)paste.1	8.1 (Berkeley) 6/6/93
3561f28255Scgd.\"
365445d018Stls.Dd June 6, 1993
3761f28255Scgd.Dt PASTE 1
3861f28255Scgd.Os
3961f28255Scgd.Sh NAME
4061f28255Scgd.Nm paste
4161f28255Scgd.Nd merge corresponding or subsequent lines of files
4261f28255Scgd.Sh SYNOPSIS
439b5a69b5Slukem.Nm
4461f28255Scgd.Op Fl s
4561f28255Scgd.Op Fl d Ar list
4661f28255Scgd.Ar file ...
4761f28255Scgd.Sh DESCRIPTION
4861f28255ScgdThe
499b5a69b5Slukem.Nm
5061f28255Scgdutility concatenates the corresponding lines of the given input files,
5161f28255Scgdreplacing all but the last file's newline characters with a single tab
5261f28255Scgdcharacter, and writes the resulting lines to standard output.
5361f28255ScgdIf end-of-file is reached on an input file while other input files
5461f28255Scgdstill contain data, the file is treated as if it were an endless source
5561f28255Scgdof empty lines.
5661f28255Scgd.Pp
5761f28255ScgdThe options are as follows:
5861f28255Scgd.Bl -tag -width Fl
5961f28255Scgd.It Fl d  Ar list
6061f28255ScgdUse one or more of the provided characters to replace the newline
6161f28255Scgdcharacters instead of the default tab.
6261f28255ScgdThe characters in
6361f28255Scgd.Ar list
6461f28255Scgdare used circularly, i.e., when
6561f28255Scgd.Ar list
6661f28255Scgdis exhausted the first character from
6761f28255Scgd.Ar list
6861f28255Scgdis reused.
6961f28255ScgdThis continues until a line from the last input file (in default operation)
7061f28255Scgdor the last line in each file (using the -s option) is displayed, at which
7161f28255Scgdtime
729b5a69b5Slukem.Nm
7361f28255Scgdbegins selecting characters from the beginning of
7461f28255Scgd.Ar list
7561f28255Scgdagain.
7661f28255Scgd.Pp
7761f28255ScgdThe following special characters can also be used in list:
7861f28255Scgd.Pp
7961f28255Scgd.Bl -tag -width flag -compact
8061f28255Scgd.It Li \en
8161f28255Scgdnewline character
8261f28255Scgd.It Li \et
8361f28255Scgdtab character
8461f28255Scgd.It Li \e\e
8561f28255Scgdbackslash character
8661f28255Scgd.It Li \e0
8761f28255ScgdEmpty string (not a null character).
8861f28255Scgd.El
8961f28255Scgd.Pp
9061f28255ScgdAny other character preceded by a backslash is equivalent to the
9161f28255Scgdcharacter itself.
9261f28255Scgd.It Fl s
9361f28255ScgdConcatenate all of the lines of each separate input file in command line
9461f28255Scgdorder.
9561f28255ScgdThe newline character of every line except the last line in each input
9661f28255Scgdfile is replaced with the tab character, unless otherwise specified by
9761f28255Scgdthe -d option.
9861f28255Scgd.El
9961f28255Scgd.Pp
10061f28255ScgdIf
10161f28255Scgd.Ql Fl
10261f28255Scgdis specified for one or more of the input files, the standard
10361f28255Scgdinput is used; standard input is read one line at a time, circularly,
10461f28255Scgdfor each instance of
10561f28255Scgd.Ql Fl .
1064931818fSjdf.Sh EXIT STATUS
1074931818fSjdf.Ex -std
10861f28255Scgd.Sh SEE ALSO
1094931818fSjdf.Xr cut 1 ,
1104931818fSjdf.Xr join 1
11161f28255Scgd.Sh STANDARDS
11261f28255ScgdThe
1139b5a69b5Slukem.Nm
11461f28255Scgdutility is expected to be
11561f28255Scgd.St -p1003.2
11661f28255Scgdcompatible.
117