xref: /csrg-svn/usr.bin/paste/paste.1 (revision 62161)
1*62161Sbostic.\" Copyright (c) 1989, 1990, 1993
2*62161Sbostic.\"	The Regents of the University of California.  All rights reserved.
343083Scael.\"
439825Sbostic.\" This code is derived from software contributed to Berkeley by
550201Sbostic.\" Adam S. Moskowitz and the Institute of Electrical and Electronics
650201Sbostic.\" Engineers, Inc.
739825Sbostic.\"
850201Sbostic.\" %sccs.include.redist.roff%
939825Sbostic.\"
10*62161Sbostic.\"	@(#)paste.1	8.1 (Berkeley) 06/06/93
1139825Sbostic.\"
1243083Scael.Dd
1343083Scael.Dt PASTE 1
1447374Scael.Os
1543083Scael.Sh NAME
1643083Scael.Nm paste
1743083Scael.Nd merge corresponding or subsequent lines of files
1843083Scael.Sh SYNOPSIS
1943083Scael.Nm paste
2043083Scael.Op Fl s
2143083Scael.Op Fl d Ar list
2243083Scael.Ar file ...
2343083Scael.Sh DESCRIPTION
2439825SbosticThe
2543083Scael.Nm paste
2639825Sbosticutility concatenates the corresponding lines of the given input files,
2739825Sbosticreplacing all but the last file's newline characters with a single tab
2839825Sbosticcharacter, and writes the resulting lines to standard output.
2939825SbosticIf end-of-file is reached on an input file while other input files
3039825Sbosticstill contain data, the file is treated as if it were an endless source
3139825Sbosticof empty lines.
3243083Scael.Pp
3339825SbosticThe options are as follows:
3450602Scael.Bl -tag -width Fl
3550602Scael.It Fl d  Ar list
3639825SbosticUse one or more of the provided characters to replace the newline
3739825Sbosticcharacters instead of the default tab.
3839825SbosticThe characters in
3943083Scael.Ar list
4039825Sbosticare used circularly, i.e., when
4143083Scael.Ar list
4239825Sbosticis exhausted the first character from
4343083Scael.Ar list
4439825Sbosticis reused.
4539825SbosticThis continues until a line from the last input file (in default operation)
4639825Sbosticor the last line in each file (using the -s option) is displayed, at which
4739825Sbostictime
4843083Scael.Nm paste
4939825Sbosticbegins selecting characters from the beginning of
5043083Scael.Ar list
5139825Sbosticagain.
5243083Scael.Pp
5339825SbosticThe following special characters can also be used in list:
5450602Scael.Pp
5550602Scael.Bl -tag -width flag -compact
5650602Scael.It Li \en
5739825Sbosticnewline character
5850602Scael.It Li \et
5939825Sbostictab character
6050602Scael.It Li \e\e
6139825Sbosticbackslash character
6250602Scael.It Li \e0
6339825SbosticEmpty string (not a null character).
6450602Scael.El
6543083Scael.Pp
6639825SbosticAny other character preceded by a backslash is equivalent to the
6739825Sbosticcharacter itself.
6850602Scael.It Fl s
6939825SbosticConcatenate all of the lines of each separate input file in command line
7039825Sbosticorder.
7139825SbosticThe newline character of every line except the last line in each input
7239825Sbosticfile is replaced with the tab character, unless otherwise specified by
7339825Sbosticthe -d option.
7450602Scael.El
7543083Scael.Pp
7650602ScaelIf
7750602Scael.Ql Fl
7850602Scaelis specified for one or more of the input files, the standard
7939825Sbosticinput is used; standard input is read one line at a time, circularly,
8050602Scaelfor each instance of
8150602Scael.Ql Fl .
8243083Scael.Pp
8339825SbosticThe
8443083Scael.Nm paste
8539825Sbosticutility exits 0 on success, and >0 if an error occurs.
8643083Scael.Sh SEE ALSO
8743083Scael.Xr cut 1
8843083Scael.Sh STANDARDS
8939825SbosticThe
9043083Scael.Nm paste
9150602Scaelutility is expected to be
9250602Scael.St -p1003.2
9350602Scaelcompatible.
94