xref: /minix3/usr.bin/lam/lam.1 (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1.\"	$NetBSD: lam.1,v 1.8 2012/12/13 21:09:34 pgoyette 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.Pp
66.Bl -tag -width "-s sepstring" -compact
67.It Fl f Ar min.max
68Print line fragments according to the format string
69.Ar min.max ,
70where
71.Ar min
72is the minimum field width and
73.Ar max
74the maximum field width.
75If
76.Ar min
77begins with a zero, zeros will be added to make up the field width,
78and if it begins with a
79.Sq \&- ,
80the fragment will be left-adjusted
81within the field.
82.It Fl p Ar min.max
83Like
84.Fl f ,
85but pad this file's field when end-of-file is reached
86and other files are still active.
87.It Fl s Ar sepstring
88Print
89.Ar sepstring
90before printing line fragments from the next file.
91This option may appear after the last file.
92.It Fl t Ar c
93The input line terminator is
94.Ar c
95instead of a newline.
96The newline normally appended to each output line is omitted.
97.El
98.Pp
99To print files simultaneously for easy viewing use
100.Xr pr 1 .
101.Sh EXAMPLES
102The command
103.Bd -literal -offset indent
104lam file1 file2 file3 file4
105.Ed
106.Pp
107joins 4 files together along each line.
108To merge the lines from four different files use
109.Bd -literal -offset indent
110lam file1 \-s "\e
111" file2 file3 file4
112.Ed
113.Pp
114Every 2 lines of a file may be joined on one line with
115.Bd -literal -offset indent
116lam \- \- \*[Lt] file
117.Ed
118.Pp
119and a form letter with substitutions keyed by
120.Sq \&@
121can be done with
122.Bd -literal -offset indent
123lam \-t @ letter changes
124.Ed
125.Sh SEE ALSO
126.Xr join 1 ,
127.Xr pr 1 ,
128.Xr printf 3
129