Annotation of src/usr.bin/look/look.1, Revision 1.8
1.8 ! aaron 1: .\" $OpenBSD: look.1,v 1.7 2000/03/06 03:17:39 aaron Exp $
1.1 deraadt 2: .\" $NetBSD: look.1,v 1.3 1994/12/23 01:10:59 jtc Exp $
3: .\"
4: .\" Copyright (c) 1990, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
15: .\" 3. All advertising materials mentioning features or use of this software
16: .\" must display the following acknowledgement:
17: .\" This product includes software developed by the University of
18: .\" California, Berkeley and its contributors.
19: .\" 4. Neither the name of the University nor the names of its contributors
20: .\" may be used to endorse or promote products derived from this software
21: .\" without specific prior written permission.
22: .\"
23: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33: .\" SUCH DAMAGE.
34: .\"
35: .\" @(#)look.1 8.1 (Berkeley) 6/14/93
36: .\"
37: .Dd June 14, 1993
38: .Dt LOOK 1
39: .Os
40: .Sh NAME
41: .Nm look
42: .Nd display lines beginning with a given string
43: .Sh SYNOPSIS
44: .Nm look
45: .Op Fl df
46: .Op Fl t Ar termchar
47: .Ar string
48: .Op Ar file
49: .Sh DESCRIPTION
1.4 aaron 50: The
51: .Nm
1.1 deraadt 52: utility displays any lines in
53: .Ar file
54: which contain
55: .Ar string
56: as a prefix.
57: As
1.4 aaron 58: .Nm
1.1 deraadt 59: performs a binary search, the lines in
60: .Ar file
61: must be sorted.
62: .Pp
63: If
64: .Ar file
65: is not specified, the file
66: .Pa /usr/share/dict/words
1.8 ! aaron 67: is used.
! 68: Only alphanumeric characters are compared and the case of
1.1 deraadt 69: alphabetic characters is ignored.
70: .Pp
1.6 aaron 71: The options are as follows:
1.1 deraadt 72: .Bl -tag -width Ds
73: .It Fl d
1.8 ! aaron 74: Dictionary character set and order, i.e., only alphanumeric characters
1.1 deraadt 75: are compared.
76: .It Fl f
77: Ignore the case of alphabetic characters.
1.3 aaron 78: .It Fl t Ar termchar
1.8 ! aaron 79: Specify a string termination character, i.e., only the characters
1.1 deraadt 80: in
81: .Ar string
82: up to and including the first occurrence of
83: .Ar termchar
84: are compared.
85: .El
86: .Pp
87: The
1.4 aaron 88: .Nm
1.1 deraadt 89: utility exits 0 if one or more lines were found and displayed,
1.8 ! aaron 90: 1 if no lines were found, or >1 if an error occurred.
1.1 deraadt 91: .Sh FILES
92: .Bl -tag -width /usr/share/dict/words -compact
93: .It Pa /usr/share/dict/words
94: the dictionary
95: .El
96: .Sh SEE ALSO
97: .Xr grep 1 ,
98: .Xr sort 1
99: .Sh COMPATIBILITY
100: The original manual page stated that tabs and blank characters participated
101: in comparisons when the
102: .Fl d
103: option was specified.
104: This was incorrect and the current man page matches the historic
105: implementation.
106: .Sh HISTORY
1.7 aaron 107: The
1.4 aaron 108: .Nm
1.7 aaron 109: command appeared in
1.5 aaron 110: .At v7 .