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