git: f3f16c31fea2 - main - look(1): Add EXAMPLES section

Fernando Apesteguía fernape at FreeBSD.org
Tue Dec 29 18:55:23 UTC 2020


The branch main has been updated by fernape (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=f3f16c31fea258b2b1ec51ddd1bceb6207b66198

commit f3f16c31fea258b2b1ec51ddd1bceb6207b66198
Author:     Fernando Apesteguía <fernape at FreeBSD.org>
AuthorDate: 2020-12-29 20:48:12 +0000
Commit:     Fernando Apesteguía <fernape at FreeBSD.org>
CommitDate: 2020-12-29 20:48:12 +0000

    look(1): Add EXAMPLES section
    
    Add two simple examples. In this case I opted to show a small portion of
    the output since it helps to understand what the tool does. It shows the use
    of the -t flag too.
    
    PR:
    Submitted by:
    Reported by:
    Reviewed by:    gbe@
    Approved by:    manpages (bcr@)
    Obtained from:
    MFC after:
    MFH:
    Relnotes:
    Security:
    Sponsored by:
    Differential Revision:  https://reviews.freebsd.org/D27543
---
 usr.bin/look/look.1 | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/usr.bin/look/look.1 b/usr.bin/look/look.1
index b2f7100da530..177306e4eb09 100644
--- a/usr.bin/look/look.1
+++ b/usr.bin/look/look.1
@@ -28,7 +28,7 @@
 .\"     @(#)look.1	8.1 (Berkeley) 6/14/93
 .\" $FreeBSD$
 .\"
-.Dd July 17, 2004
+.Dd December 29, 2020
 .Dt LOOK 1
 .Os
 .Sh NAME
@@ -96,6 +96,35 @@ The
 .Nm
 utility exits 0 if one or more lines were found and displayed,
 1 if no lines were found, and >1 if an error occurred.
+.Sh EXAMPLES
+Look for lines starting with
+.Ql xylene
+in the file
+.Pa /usr/share/dict/words :
+.Bd -literal -offset indent
+$ look xylen
+xylene
+xylenol
+xylenyl
+.Ed
+.Pp
+Same as above, but do not consider any characters in
+.Ar string
+beyond the first
+.Ql e .
+Note that
+.Fl f
+is implicit since we are searching the default file
+.Pa /usr/share/dict/words :
+.Bd -literal -offset indent
+$ look -t e xylen
+Xyleborus
+xylem
+xylene
+xylenol
+xylenyl
+xyletic
+.Ed
 .Sh COMPATIBILITY
 The original manual page stated that tabs and blank characters participated
 in comparisons when the


More information about the dev-commits-src-all mailing list