aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorRicardo Branco <rbranco@suse.de>2024-01-15 18:35:27 +0000
committerWarner Losh <imp@FreeBSD.org>2024-01-15 18:47:24 +0000
commit2a121b97e9673ff37062c9fa026eee969940d2e2 (patch)
tree74613e52f291ac8c8cb9017f4fcd815354a1d3e2 /usr.bin
parentec13a838e6857585d3c3db70a0a67e337248ec28 (diff)
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/find/find.119
-rw-r--r--usr.bin/find/function.c2
2 files changed, 17 insertions, 4 deletions
diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1
index de16b012ce4d..856961d02395 100644
--- a/usr.bin/find/find.1
+++ b/usr.bin/find/find.1
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd December 22, 2023
+.Dd January 15, 2024
.Dt FIND 1
.Os
.Sh NAME
@@ -757,7 +757,7 @@ Slashes
.Pq Dq Li /
are treated as normal characters and do not have to be
matched explicitly.
-.It Ic -perm Oo Cm - Ns | Ns Cm + Oc Ns Ar mode
+.It Ic -perm Oo Cm - Ns | Ns Cm + Ns | Ns Cm / Oc Ns Ar mode
The
.Ar mode
may be either symbolic (see
@@ -786,11 +786,14 @@ are set in the file's mode bits.
If the
.Ar mode
is preceded by a plus
-.Pq Dq Li + ,
+.Pq Dq Li +
this primary evaluates to true
if any of the bits in the
.Ar mode
are set in the file's mode bits.
+A slash
+.Pq Dq Li /
+is also accepted with the same meaning as plus for compatibility with GNU find.
Otherwise, this primary evaluates to true if
the bits in the
.Ar mode
@@ -1116,6 +1119,16 @@ option was inspired by the equivalent
and
.Xr sed 1
options.
+.Pp
+The
+.Ic -perm
+primary accepts a leading slash
+.Pq Dq Li /
+as an alias for a leading plus
+.Pq Dq Li +
+for its argument as an extension of
+.St -p1003.1-2001
+to be compatible with GNU find.
.Sh HISTORY
A simple
.Nm
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index 43aa2301439c..f96a086cbda3 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -1338,7 +1338,7 @@ c_perm(OPTION *option, char ***argvp)
if (*perm == '-') {
new->flags |= F_ATLEAST;
++perm;
- } else if (*perm == '+') {
+ } else if (*perm == '+' || *perm == '/') {
new->flags |= F_ANY;
++perm;
}