[BACK]Return to paste.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / paste

Annotation of src/usr.bin/paste/paste.1, Revision 1.6

1.6     ! aaron       1: .\"    $OpenBSD: paste.1,v 1.5 2000/03/10 20:17:49 aaron Exp $
1.5       aaron       2: .\"
1.1       deraadt     3: .\" Copyright (c) 1989, 1990 The Regents of the University of California.
                      4: .\" All rights reserved.
                      5: .\"
                      6: .\" This code is derived from software contributed to Berkeley by
                      7: .\" Adam S. Moskowitz and the Institute of Electrical and Electronics
                      8: .\" Engineers, Inc.
                      9: .\"
                     10: .\" Redistribution and use in source and binary forms, with or without
                     11: .\" modification, are permitted provided that the following conditions
                     12: .\" are met:
                     13: .\" 1. Redistributions of source code must retain the above copyright
                     14: .\"    notice, this list of conditions and the following disclaimer.
                     15: .\" 2. Redistributions in binary form must reproduce the above copyright
                     16: .\"    notice, this list of conditions and the following disclaimer in the
                     17: .\"    documentation and/or other materials provided with the distribution.
                     18: .\" 3. All advertising materials mentioning features or use of this software
                     19: .\"    must display the following acknowledgement:
                     20: .\"    This product includes software developed by the University of
                     21: .\"    California, Berkeley and its contributors.
                     22: .\" 4. Neither the name of the University nor the names of its contributors
                     23: .\"    may be used to endorse or promote products derived from this software
                     24: .\"    without specific prior written permission.
                     25: .\"
                     26: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     27: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     28: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     29: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     30: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     31: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     32: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     33: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     34: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     35: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     36: .\" SUCH DAMAGE.
                     37: .\"
                     38: .\"    from: @(#)paste.1       5.6 (Berkeley) 7/27/91
                     39: .\"
                     40: .Dd July 27, 1991
                     41: .Dt PASTE 1
                     42: .Os
                     43: .Sh NAME
                     44: .Nm paste
                     45: .Nd merge corresponding or subsequent lines of files
                     46: .Sh SYNOPSIS
                     47: .Nm paste
                     48: .Op Fl s
                     49: .Op Fl d Ar list
1.3       aaron      50: .Ar file Op Ar ...
1.1       deraadt    51: .Sh DESCRIPTION
                     52: The
                     53: .Nm paste
                     54: utility concatenates the corresponding lines of the given input files,
                     55: replacing all but the last file's newline characters with a single tab
                     56: character, and writes the resulting lines to standard output.
                     57: If end-of-file is reached on an input file while other input files
                     58: still contain data, the file is treated as if it were an endless source
                     59: of empty lines.
                     60: .Pp
                     61: The options are as follows:
1.6     ! aaron      62: .Bl -tag -width Ds
1.5       aaron      63: .It Fl d Ar list
1.1       deraadt    64: Use one or more of the provided characters to replace the newline
                     65: characters instead of the default tab.
                     66: The characters in
                     67: .Ar list
                     68: are used circularly, i.e., when
                     69: .Ar list
                     70: is exhausted the first character from
                     71: .Ar list
                     72: is reused.
                     73: This continues until a line from the last input file (in default operation)
1.3       aaron      74: or the last line in each file (using the
                     75: .Fl s
                     76: option) is displayed, at which
1.1       deraadt    77: time
                     78: .Nm paste
                     79: begins selecting characters from the beginning of
                     80: .Ar list
                     81: again.
                     82: .Pp
                     83: The following special characters can also be used in list:
                     84: .Pp
                     85: .Bl -tag -width flag -compact
                     86: .It Li \en
                     87: newline character
                     88: .It Li \et
                     89: tab character
                     90: .It Li \e\e
                     91: backslash character
                     92: .It Li \e0
1.3       aaron      93: empty string (not a null character)
1.1       deraadt    94: .El
                     95: .Pp
                     96: Any other character preceded by a backslash is equivalent to the
                     97: character itself.
                     98: .It Fl s
                     99: Concatenate all of the lines of each separate input file in command line
                    100: order.
                    101: The newline character of every line except the last line in each input
                    102: file is replaced with the tab character, unless otherwise specified by
1.3       aaron     103: the
                    104: .Fl d
                    105: option.
1.1       deraadt   106: .El
                    107: .Pp
                    108: If
1.5       aaron     109: .Dq -
1.1       deraadt   110: is specified for one or more of the input files, the standard
                    111: input is used; standard input is read one line at a time, circularly,
                    112: for each instance of
1.5       aaron     113: .Dq - .
1.1       deraadt   114: .Pp
                    115: The
                    116: .Nm paste
1.3       aaron     117: utility exits 0 on success or >0 if an error occurred.
1.1       deraadt   118: .Sh SEE ALSO
                    119: .Xr cut 1
                    120: .Sh STANDARDS
                    121: The
                    122: .Nm paste
                    123: utility is expected to be
                    124: .St -p1003.2
                    125: compatible.