Commit Graph

161 Commits

Author SHA1 Message Date
jmcneill e816b5f7a6 Don't error out while searching for empty directories, from FreeBSD:
http://lists.freebsd.org/pipermail/svn-src-head/2010-December/022913.html
2011-02-24 02:55:18 +00:00
dholland f4f54a9c39 Fix "-exec blah blah {} +" so it only matches when the {} is last, as
per the standard. Per (brief) discussion on tech-userlevel.

There should really be a form where you can do the equivalent of
"-exec blah {} blah +", but I think we're going to need to call it
something other than -exec. As it is it's sort of surprising that the
standards people didn't add a different name -- note what happens if
you try to do something like "find ... -exec expr {} + 2 \;".
2011-01-06 08:18:42 +00:00
christos d6d145ee46 only setup siginfo handler if we have a tty. 2010-12-28 15:28:31 +00:00
christos a6dac2b7b7 The SIGINFO changes made the sigprocmask syscalls dominate all the rest:
- Don't bother dealing with signal masks if we are not connected to a tty.
- Compute the blocking mask only once.
- Only do the block-unblock game only when we are going to do something
  (execute, print a warning, etc.)
2010-12-27 16:09:46 +00:00
wiz fcf318eda4 Fix typos found by Ryo HAYASAKA in PR 43857.
While here, split file systems that grew together.
2010-09-09 11:42:13 +00:00
dsl fe39abeba9 Clarify (hopefully) the description of -remove.
Fixes PR/38987
2009-11-06 21:03:12 +00:00
joerg 63ec927bcc Use -compact + explicit .Pp instead of .sp with negative line length. 2009-10-15 02:26:38 +00:00
lukem c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
wiz 1ee045f360 Fix first part of PR 38987 by Robert Elz:
.Dq needs punctuation quoted to mark it up.

I leave 2) and 3) of that PR open for someone else...
2009-01-04 12:13:56 +00:00
christos 8663e57614 fix dev_t format 2008-12-29 00:53:43 +00:00
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
lukem 1db82cf8e6 revert previous thinko 2007-09-25 04:10:12 +00:00
lukem 2212f6b672 remove unnecessary #include 2007-09-25 04:09:03 +00:00
daniel 02dcfb175e Add the '-E' option to interpret regexes as extended regexes. While we
are here, fix ordering in usage information by putting '-X' in the proper
place.

Addition of '-E' was discussed on tech-userlevel.
2007-07-19 07:49:30 +00:00
christos b1b89f5d46 eliminate MFSNAMELEN 2007-07-17 21:35:29 +00:00
wiz 08287ce407 Remove macrobreaking whitespace. 2007-03-08 21:23:00 +00:00
perry 851b2b6abe Add a missing "can". Update date. 2007-02-08 13:32:53 +00:00
perry 9cf20bf4dc make -rm an alias for -delete 2007-02-06 15:33:22 +00:00
perry bf9831bfd2 Document -rm as an alias for -delete, and document that both -delete
and -rm are extensions.
2007-02-06 15:33:21 +00:00
elad a706fb0965 Add -delete from FreeBSD. 2007-02-06 13:25:01 +00:00
christos ca93cf9ea4 fix spello (from Anon Ymous) 2007-02-02 15:48:54 +00:00
wiz b7d64c2725 Fix typo. 2007-02-02 07:27:15 +00:00
christos a9ee9264a7 document -xdev [from Anon Ymous] 2007-02-01 19:00:16 +00:00
he cb49bdddc9 Adapt find to the move of string_to_flags() and flags_to_string() to
libutil.
2006-12-14 20:55:56 +00:00
christos 1dcd74fde3 eliminate alloca use. 2006-11-09 20:50:53 +00:00
tacha 7a76839cea All members of PLAN should be initialized. 2006-10-12 08:46:18 +00:00
apb 2eed134b40 De-__P(), remove trailing spaces, sprinkle a few const, WARNS=4. 2006-10-11 19:51:10 +00:00
apb bfb3f336ef Document "find ... -exec ... {} +". Also make some other minor updates.
Changes initially supplied by John Hawkinson in PR 20470, but edited by me.

/msg wizd: search for ".sp"
2006-10-07 17:06:28 +00:00
apb b90dcb5d01 Add support for "find ... -exec ... {} +".
The code is from John Hawkinson in PR 20470.  I adapted it to current,
and made some KNF and comment changes.
2006-10-07 17:04:02 +00:00
apb dbe2acacef Add some missing entries in lists, and some serial commas.
Inspired by PR 20470 from John Hawkinson.
2006-10-07 16:34:06 +00:00
uebayasi c9ce60a1ed PR32022 - Clarify find(1) syntax documentation about parenthesized expressions
and the -f option (explicit hierarchy specifier).  From "Sander Bos, with
credits to Peter Bex".

Bump date.
2006-09-23 05:03:33 +00:00
christos cdab3a7a06 More programs using efun. 2006-08-26 18:17:41 +00:00
mrg 084c052803 quell GCC 4.1 uninitialised variable warnings.
XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
2006-05-10 21:53:14 +00:00
jschauma a32f19d465 Add a new primary '-exit n':
This primary causes find to stop traversing the filesystem and
exit immediately if a previous condition was met.  If no value is
specified, the exit value will be 0, else n.  Note that other
primaries will be evaluated and acted upon before exiting.

Ok matt@, garbled@.
2006-02-20 16:31:02 +00:00
reed 9695cc3899 Add -false switch. From man page:
-false  This primary always evaluates to false.  This can be used follow-
        ing a primary that caused the expression to be true to make the
	expression to be false.  This can be useful after using a -fprint
	primary so it can continue to the next expression (using an -or
	operator, for example).

This was brought up on the tech-userlevel list in October.

Using -fprint on findutils or new NetBSD find(1) does not do what
I wanted. For example, if saving results of all files that start
with a vowel or saving results of all files owned by group operator,
then the list of files owned by group operator would not include
the files starting with a vowel.

findutils's find has a workaround for this with -false and also a
"," comma opeator. (I made add this comma operator later; you can use
the comma to perform multiple independent tests.)
2005-11-09 00:47:16 +00:00
elad 47ebf29d74 Revert, as requested by cube@. 2005-10-19 12:25:51 +00:00
elad 7f482dd3ce Strip trailing slashes before using the path.
PR/31869.
2005-10-19 12:17:22 +00:00
wiz 34cace8bd1 Bump date for previous. 2005-10-12 20:10:45 +00:00
reed 4129c05469 This adds -fprint function. The primary name "-fprint" (but not the
code) comes from findutils; it behaves the same.

From my manpage addition:

 -fprint filename
	This primary always evaluates to true.  This creates filename or
	overwrites the file if it already exists.  The file is created at
	startup.  It writes the pathname of the current file to this
	file, followed by a newline character.  The file will be empty if
	no files are matched.

Here is an example usage:

find /etc \( -name "*pass*" -fprint file1 \) -o \( -group operator -fprint file2 \) -o -name "w*"

Note that this example will NOT include entry in file2 if it is
matched in first expression. (This also is same behaviour as
findutils, and I have implemented a -false primary to handle that.
I will commit it later.)

This creates the file as command line argument parsing time.
If there is an error somewhere on that line, such as missing values
or mismatched parenthesis, then a file may still be created.
(Even if a later -fprint filename is unwritable.) This is similar
behaviour to findutils. (It has been suggested that this find could
be code to create the files in an extra stage after the command-line
argument parsing and before the actual function processing.)

I will add -fprintx and -fprint0 soon.

This was discussed on tech-userlevel.
2005-10-12 20:03:59 +00:00
christos c05266af8a fix setmode error handling. 2005-10-01 20:23:54 +00:00
mrg 3a96c9add9 add a "file" to the arguments that isn't enclosed in square brackets
making it clear that at least one file/directory argument is required
in both the manual and usage.  "find" with no args currently barfs but
these documents implied it would do something useful.
2005-08-10 06:51:24 +00:00
mycroft c860ec870a Use FD_CLOEXEC (for -exec). 2005-01-19 01:03:16 +00:00
atatat 4b9429a08d Attack of the whiteout police, including the "fix whitespace problems"
department followed by the "and fix the the ifdefs as well" brigade,
leading to a janitorial "just combine those two" strike team.
2004-12-28 05:11:07 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
lukem 5d3311e08a tweak roff in previous 2004-04-19 00:28:11 +00:00
lukem 3333d5f7f7 Use "sysctl vfs.generic.fstypes" to determine the list of available fstypes. 2004-04-19 00:18:46 +00:00
wiz e3366bb6be Bump date for previous, and sort a bit. 2004-03-31 01:46:22 +00:00
heas a7353cbe7c Mention -type w, which is coded as a synonym for W (whitespace). 2004-03-30 22:54:04 +00:00
heas 171a04291f Whitespace nit 2004-03-30 22:51:55 +00:00
heas 59d5c91fe0 Do not skip whiteout files returned by fts_read(), which only returns them if
requested.

Patch from Dave Huang in PR bin/5419.
2004-03-30 22:51:13 +00:00