xref: /freebsd/usr.bin/paste/paste.1 (revision 9b50d9027575220cb6dd09b3e62f03f511e908b8)
19b50d902SRodney W. Grimes.\" Copyright (c) 1989, 1990, 1993
29b50d902SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
39b50d902SRodney W. Grimes.\"
49b50d902SRodney W. Grimes.\" This code is derived from software contributed to Berkeley by
59b50d902SRodney W. Grimes.\" Adam S. Moskowitz and the Institute of Electrical and Electronics
69b50d902SRodney W. Grimes.\" Engineers, Inc.
79b50d902SRodney W. Grimes.\"
89b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
99b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions
109b50d902SRodney W. Grimes.\" are met:
119b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
129b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
139b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
149b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
159b50d902SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
169b50d902SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
179b50d902SRodney W. Grimes.\"    must display the following acknowledgement:
189b50d902SRodney W. Grimes.\"	This product includes software developed by the University of
199b50d902SRodney W. Grimes.\"	California, Berkeley and its contributors.
209b50d902SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
219b50d902SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
229b50d902SRodney W. Grimes.\"    without specific prior written permission.
239b50d902SRodney W. Grimes.\"
249b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
259b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
269b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
279b50d902SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
289b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
299b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
309b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
319b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
329b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
339b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
349b50d902SRodney W. Grimes.\" SUCH DAMAGE.
359b50d902SRodney W. Grimes.\"
369b50d902SRodney W. Grimes.\"	@(#)paste.1	8.1 (Berkeley) 6/6/93
379b50d902SRodney W. Grimes.\"
389b50d902SRodney W. Grimes.Dd June 6, 1993
399b50d902SRodney W. Grimes.Dt PASTE 1
409b50d902SRodney W. Grimes.Os
419b50d902SRodney W. Grimes.Sh NAME
429b50d902SRodney W. Grimes.Nm paste
439b50d902SRodney W. Grimes.Nd merge corresponding or subsequent lines of files
449b50d902SRodney W. Grimes.Sh SYNOPSIS
459b50d902SRodney W. Grimes.Nm paste
469b50d902SRodney W. Grimes.Op Fl s
479b50d902SRodney W. Grimes.Op Fl d Ar list
489b50d902SRodney W. Grimes.Ar file ...
499b50d902SRodney W. Grimes.Sh DESCRIPTION
509b50d902SRodney W. GrimesThe
519b50d902SRodney W. Grimes.Nm paste
529b50d902SRodney W. Grimesutility concatenates the corresponding lines of the given input files,
539b50d902SRodney W. Grimesreplacing all but the last file's newline characters with a single tab
549b50d902SRodney W. Grimescharacter, and writes the resulting lines to standard output.
559b50d902SRodney W. GrimesIf end-of-file is reached on an input file while other input files
569b50d902SRodney W. Grimesstill contain data, the file is treated as if it were an endless source
579b50d902SRodney W. Grimesof empty lines.
589b50d902SRodney W. Grimes.Pp
599b50d902SRodney W. GrimesThe options are as follows:
609b50d902SRodney W. Grimes.Bl -tag -width Fl
619b50d902SRodney W. Grimes.It Fl d  Ar list
629b50d902SRodney W. GrimesUse one or more of the provided characters to replace the newline
639b50d902SRodney W. Grimescharacters instead of the default tab.
649b50d902SRodney W. GrimesThe characters in
659b50d902SRodney W. Grimes.Ar list
669b50d902SRodney W. Grimesare used circularly, i.e., when
679b50d902SRodney W. Grimes.Ar list
689b50d902SRodney W. Grimesis exhausted the first character from
699b50d902SRodney W. Grimes.Ar list
709b50d902SRodney W. Grimesis reused.
719b50d902SRodney W. GrimesThis continues until a line from the last input file (in default operation)
729b50d902SRodney W. Grimesor the last line in each file (using the -s option) is displayed, at which
739b50d902SRodney W. Grimestime
749b50d902SRodney W. Grimes.Nm paste
759b50d902SRodney W. Grimesbegins selecting characters from the beginning of
769b50d902SRodney W. Grimes.Ar list
779b50d902SRodney W. Grimesagain.
789b50d902SRodney W. Grimes.Pp
799b50d902SRodney W. GrimesThe following special characters can also be used in list:
809b50d902SRodney W. Grimes.Pp
819b50d902SRodney W. Grimes.Bl -tag -width flag -compact
829b50d902SRodney W. Grimes.It Li \en
839b50d902SRodney W. Grimesnewline character
849b50d902SRodney W. Grimes.It Li \et
859b50d902SRodney W. Grimestab character
869b50d902SRodney W. Grimes.It Li \e\e
879b50d902SRodney W. Grimesbackslash character
889b50d902SRodney W. Grimes.It Li \e0
899b50d902SRodney W. GrimesEmpty string (not a null character).
909b50d902SRodney W. Grimes.El
919b50d902SRodney W. Grimes.Pp
929b50d902SRodney W. GrimesAny other character preceded by a backslash is equivalent to the
939b50d902SRodney W. Grimescharacter itself.
949b50d902SRodney W. Grimes.It Fl s
959b50d902SRodney W. GrimesConcatenate all of the lines of each separate input file in command line
969b50d902SRodney W. Grimesorder.
979b50d902SRodney W. GrimesThe newline character of every line except the last line in each input
989b50d902SRodney W. Grimesfile is replaced with the tab character, unless otherwise specified by
999b50d902SRodney W. Grimesthe -d option.
1009b50d902SRodney W. Grimes.El
1019b50d902SRodney W. Grimes.Pp
1029b50d902SRodney W. GrimesIf
1039b50d902SRodney W. Grimes.Ql Fl
1049b50d902SRodney W. Grimesis specified for one or more of the input files, the standard
1059b50d902SRodney W. Grimesinput is used; standard input is read one line at a time, circularly,
1069b50d902SRodney W. Grimesfor each instance of
1079b50d902SRodney W. Grimes.Ql Fl .
1089b50d902SRodney W. Grimes.Pp
1099b50d902SRodney W. GrimesThe
1109b50d902SRodney W. Grimes.Nm paste
1119b50d902SRodney W. Grimesutility exits 0 on success, and >0 if an error occurs.
1129b50d902SRodney W. Grimes.Sh SEE ALSO
1139b50d902SRodney W. Grimes.Xr cut 1
1149b50d902SRodney W. Grimes.Sh STANDARDS
1159b50d902SRodney W. GrimesThe
1169b50d902SRodney W. Grimes.Nm paste
1179b50d902SRodney W. Grimesutility is expected to be
1189b50d902SRodney W. Grimes.St -p1003.2
1199b50d902SRodney W. Grimescompatible.
120