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