From nobody Fri Apr 21 19:12:40 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q340v1sdbz46lxL for ; Fri, 21 Apr 2023 19:12:47 +0000 (UTC) (envelope-from yuri@aetern.org) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q340t4sYYz47lf for ; Fri, 21 Apr 2023 19:12:46 +0000 (UTC) (envelope-from yuri@aetern.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=aetern.org header.s=fm2 header.b=lKxr2FXx; dkim=pass header.d=messagingengine.com header.s=fm3 header.b="G wqSPkj"; spf=pass (mx1.freebsd.org: domain of yuri@aetern.org designates 64.147.123.19 as permitted sender) smtp.mailfrom=yuri@aetern.org Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id C0C8632002E8 for ; Fri, 21 Apr 2023 15:12:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 21 Apr 2023 15:12:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aetern.org; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1682104362; x=1682190762; bh=yS5MNIFZxlDDzUxsWOi/LcdeHn7WK7YtnTm B4c5vJSM=; b=lKxr2FXx/Ljwqh/qk/1u/MUBTrC2GRFLKTnMoaPs5SY+ACRdDtp ssDxAIbqPJatrrylQNkFKYU0GOhdTrDwAc0qiA3bsFkHAk8z4Vj3XiJ0WBW1q7kC Vc2ntLgzbNMio9PxCAQcTiQN7NoyT3MOCJMiDhjBKUDxDbmPF+iGbioH/QhxdNRb K8rhAWrcDbpfKLTPzsUhU6LuNJRLRNpoOTY3u1Z8DDkv9X6DYJkj6j8GqC/tJ7au KxwbEIGgkmNR1Qca9JF/Sq6DxmjZ8MT2yxtnMBVsC4jRHP4ppPBq7wc0X5QegD3B XjMuSJfVtRB19GYhCZhtCMOiP0GFQSU6Mzg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1682104362; x= 1682190762; bh=yS5MNIFZxlDDzUxsWOi/LcdeHn7WK7YtnTmB4c5vJSM=; b=G wqSPkj/SMWKcFh/SednxyBhOa8ey3RsrZspqwDrHygf70JGJM+b+D+bXc3FDR6Jb S2gFUr1WSwXpFv3pX+FrQI97MQ9T7Aceg70QQZ99qGyLcFBs5vgdcumxFXE6N7p7 wHOfZ7nWbtbacnVGyqHIiEBea7L0y9s0lMwWR0OZ5Dq1vepbaOZSpfXslUyV8nrs dalnhJVMpempiZNfI4rzKqTdx7F6y/+T94XEPWWc+EZz+du4TNIAfJd8+wwjEbqC lOk1gj0iZh8A4w/6v0DVWthdEHbmMKmICm5VN6g++3zembzFM/Axdv8zF4HfZZs2 YZFk8zhUw+HiAaCy+7VHg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedtgedgudeffecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesth ejredttdefjeenucfhrhhomhepjghurhhiuceohihurhhisegrvghtvghrnhdrohhrgheq necuggftrfgrthhtvghrnheptdfhvedtgeetgfeiveduteeiheduueevgfekffdtffejle ehleduvddugedvjeelnecuffhomhgrihhnpehophgvnhhgrhhouhhprdhorhhgpdhfrhgv vggsshgurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhephihurhhisegrvghtvghrnhdrohhrgh X-ME-Proxy: Feedback-ID: i0d79475b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 21 Apr 2023 15:12:41 -0400 (EDT) Message-ID: Date: Fri, 21 Apr 2023 21:12:40 +0200 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: find(1): I18N gone wild ? Content-Language: en-US To: freebsd-current@FreeBSD.org References: <3e473603-f384-f176-e7cb-03409e16ec9c@aetern.org> <202304211904.33LJ4TA3044065@donotpassgo.dyslexicfish.net> From: Yuri In-Reply-To: <202304211904.33LJ4TA3044065@donotpassgo.dyslexicfish.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Q340t4sYYz47lf X-Spamd-Bar: / X-Spamd-Result: default: False [0.60 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; R_DKIM_ALLOW(-0.20)[aetern.org:s=fm2,messagingengine.com:s=fm3]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.19]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; local_wl_from(0.00)[yuri@aetern.org]; DKIM_TRACE(0.00)[aetern.org:+,messagingengine.com:+]; ASN(0.00)[asn:29838, ipnet:64.147.123.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: local_wl_from X-ThisMailContainsUnwantedMimeParts: N Jamie Landeg-Jones wrote: > Yuri wrote: > >>> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13 >>> >>> ...which in turn refers to the following link for bracket expressions: >>> >>> https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05 >>> >>> Why we don't support all of that is different story. >> >> A bit more on this; first link applies both to find(1) and fnmatch(3), >> and find uses fnmatch() internally (which is good), but even the >> function that processes bracket expressions is called rangematch() and >> that's really all it does ignoring other bracket expression rules: >> >> https://cgit.freebsd.org/src/tree/lib/libc/gen/fnmatch.c#n234 >> >> So to "fix" find we just need to implement the bracket expressions >> properly in fnmatch(). > > No. find "-name" works with GLOBs not regex. No, find "-name" works with pattern rules in the first link, please see: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html > The functionality you are talking about, and the page you quoted refer to regular expressions. The functionality I am talking about is defined in find specification above, the only relation to REs is for bracket expressions (with ! instead of ^). > For that, you use find "-regex" - note that the regex is assumed anchored, so: > > $ LANG=en_US.UTF-8 find -E /etc/rc.d -regex '.*[[:upper:]]+' -print > /etc/rc.d/NETWORKING > /etc/rc.d/FILESYSTEMS > /etc/rc.d/SERVERS > /etc/rc.d/DAEMON > /etc/rc.d/LOGIN > $ > > Jamie >