Subject: CVS commit: [netbsd-2] src/usr.bin/find
To: None <source-changes@NetBSD.org>
From: Jeremy C. Reed <email@example.com>
Date: 10/11/2005 22:56:27
Module Name: src
Committed By: reed
Date: Tue Oct 11 22:56:27 UTC 2005
src/usr.bin/find [netbsd-2]: extern.h find.1 find.c find.h function.c
This adds -fprint function. The primary name "-fprint" (but not the
code) comes from findutils; it behaves the same.
From my manpage addition:
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*"
This was discussed on tech-userlevel.
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.
To generate a diff of this commit:
cvs rdiff -r1.20 -r220.127.116.11 src/usr.bin/find/extern.h \
cvs rdiff -r18.104.22.168 -r22.214.171.124.2.1 src/usr.bin/find/find.1
cvs rdiff -r126.96.36.199 -r188.8.131.52.2.1 src/usr.bin/find/find.c
cvs rdiff -r1.18 -r184.108.40.206 src/usr.bin/find/find.h
cvs rdiff -r1.46 -r220.127.116.11 src/usr.bin/find/function.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.