Subject: misc/32022: find(1) syntax documentation incorrect
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <Peter.Bex@student.kun.nl>
List: netbsd-bugs
Date: 11/08/2005 23:57:00
>Number:         32022
>Category:       misc
>Synopsis:       find(1) manpage's SYNOPSIS line and composite expression syntax incorrect
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 08 23:57:00 +0000 2005
>Originator:     Sander Bos, with credits to Peter Bex
>Release:        NetBSD 3.99.11
>Organization:
	
>Environment:
	
	
System: NetBSD langly.nvie.com 3.99.11 NetBSD 3.99.11 (LANGLY) #0: Tue Nov 8 08:20:27 CET 2005 sjamaan@langly.nvie.com:/usr/src/sys/arch/i386/compile/LANGLY i386
Architecture: i386
Machine: i386
>Description:
	find(1) manpage states in the SYNOPSIS line that the file argument
	is mandatory, while this is not true if -f file is specified.
	
	In section OPERATORS the parenthesized expressions need to be separated
	with a space from the exclamation mark and the parentheses. See
	attached patch.
>How-To-Repeat:
	Examples:

	% find . \(-name foo\)
	<All files in current working dir>
	find: (-name: No such file or directory
	find: foo): No such file or directory

	% find . \( -name foo \)
	foo

	(same for !)

	% find -f foo
	foo

	% find foo
	foo

	% find -f foo bar
	foo
	bar

	% find
	usage: find [-H | -L | -P] [-Xdhsx] [-f file] file [file ...] [expression]

	NOTE: This may be incorrect as well, since the manpage's SYNOPSIS has
	changed.  (though man(1)'s usage line doesn't match the SYNOPSIS lines
	of its manpage either...)

>Fix:


Index: find.1
===================================================================
RCS file: /cvsroot/src/usr.bin/find/find.1,v
retrieving revision 1.54
diff -u -r1.54 find.1
--- find.1	12 Oct 2005 20:10:45 -0000	1.54
+++ find.1	8 Nov 2005 23:20:43 -0000
@@ -39,13 +39,18 @@
 .Nm find
 .Nd walk a file hierarchy
 .Sh SYNOPSIS
-.Nm find
+.Nm
 .Op Fl H | Fl L | Fl P
 .Op Fl dhsXx
-.Op Fl f Ar file
 .Ar file
 .Op Ar file ...
-.Ar expression
+.Op Ar expression
+.Nm
+.Op Fl H | Fl L | Fl P
+.Op Fl dhsXx
+.Fl f Ar file
+.Op Ar file ...
+.Op Ar expression
 .Sh DESCRIPTION
 .Nm
 recursively descends the directory tree for each
@@ -543,11 +548,11 @@
 The primaries may be combined using the following operators.
 The operators are listed in order of decreasing precedence.
 .Bl -tag -width (expression)
-.It Cm \&( Ns Ar expression Ns Cm \&)
+.It Cm \&( Ar expression Cm \&)
 This evaluates to true if the parenthesized expression evaluates to
 true.
 .Pp
-.It Cm \&! Ns Ar expression
+.It Cm \&! Ar expression
 This is the unary
 .Tn NOT
 operator.

>Unformatted: