Subject: Re: multi find with different file outputs
To: None <tech-userlevel@NetBSD.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-userlevel
Date: 10/12/2005 11:51:26
I also added the -false primary as found with findutils's find(1).
Using my -fprint on findutils or my hacked 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.
Here is my manpage addition:
-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).
And:
find / \( -newer ttt -fprint ~/newer-file -false \) -o \
\( -user wnj -fprint ~/wnj-file \)
The list of files that are newer than ``ttt'' are saved to a file
named ``~/newer-file''; and the list of files owned by ``wnj'' are
saved to a file named ``~/wnj-file''. The -false primary is
important so that the ``~/wnj-file'' results file will also con-
tain the list of files newer than ``ttt''.
The alternative is to have -fprint always return false, which may not be
expected behaviour and is different from findutils.
Jeremy C. Reed
p.s. How can I get the formatting correct with mdoc for above example?
I have:
.It Li "find / \e( -newer ttt -fprint ~/newer-file -false \e) -o \e"
.It Li " \e( -user wnj -fprint ~/wnj-file \e)"
The list of files that are newer than
How can I improve the above?
Should I just put the entire long find command on one line and let the
reader figure it out?