1.\" $NetBSD: lam.1,v 1.4 2002/02/08 01:36:25 ross Exp $ 2.\" 3.\" Copyright (c) 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by the University of 17.\" California, Berkeley and its contributors. 18.\" 4. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" @(#)lam.1 8.1 (Berkeley) 6/6/93 35.\" 36.Dd December 1, 2001 37.Dt LAM 1 38.Os 39.Sh NAME 40.Nm lam 41.Nd laminate files 42.Sh SYNOPSIS 43.Nm 44.Op Fl f Ar min.max 45.Op Fl p Ar min.max 46.Op Fl s Ar sepstring 47.Op Fl t Ar c 48.Ar file ... 49.Sh DESCRIPTION 50.Nm 51copies the named files side by side onto the standard output. 52The 53.Em n Ns -th 54input lines from the input 55.Ar files 56are considered fragments of the single long 57.Em n Ns -th 58output line into which they are assembled. 59The name 60.Dq \&- 61means the standard input, and may be repeated. 62.Pp 63Normally, each option affects only the 64.Ar file 65after it. 66If the option letter is capitalized it affects all subsequent files 67until it appears again uncapitalized. 68The options are described below. 69.Bl -tag -width "-s sepstring" -compact 70.It Fl f Ar min.max 71Print line fragments according to the format string 72.Ar min.max , 73where 74.Ar min 75is the minimum field width and 76.Ar max 77the maximum field width. 78If 79.Ar min 80begins with a zero, zeros will be added to make up the field width, 81and if it begins with a 82.Sq \&- , 83the fragment will be left-adjusted 84within the field. 85.It Fl p Ar min.max 86Like 87.Fl f , 88but pad this file's field when end-of-file is reached 89and other files are still active. 90.It Fl s Ar sepstring 91Print 92.Ar sepstring 93before printing line fragments from the next file. 94This option may appear after the last file. 95.It Fl t Ar c 96The input line terminator is 97.Ar c 98instead of a newline. 99The newline normally appended to each output line is omitted. 100.El 101.Pp 102To print files simultaneously for easy viewing use 103.Xr pr 1 . 104.Sh EXAMPLES 105The command 106.Bd -literal -offset indent 107lam file1 file2 file3 file4 108.Ed 109.Pp 110joins 4 files together along each line. 111To merge the lines from four different files use 112.Bd -literal -offset indent 113lam file1 \-S "\\ 114" file2 file3 file4 115.Ed 116.Pp 117Every 2 lines of a file may be joined on one line with 118.Bd -literal -offset indent 119lam \- \- \*[Lt] file 120.Ed 121.Pp 122and a form letter with substitutions keyed by 123.Sq \&@ 124can be done with 125.Bd -literal -offset indent 126lam \-t @ letter changes 127.Ed 128.Sh SEE ALSO 129.Xr join 1 , 130.Xr pr 1 , 131.Xr printf 3 132