From owner-freebsd-current@freebsd.org Wed Feb 17 22:26:43 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55F34537DC3 for ; Wed, 17 Feb 2021 22:26:43 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic310-22.consmr.mail.gq1.yahoo.com (sonic310-22.consmr.mail.gq1.yahoo.com [98.137.69.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dgsrg0SbZz3pSQ for ; Wed, 17 Feb 2021 22:26:42 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1613600800; bh=avxMNv7+smr2rmJp6tgumEpPzBm/ca0h5lv65P0kCSY=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=ZJZ1DZIyuM6IyeSXqQwC0ccYMiG0/Z3fTvvRq8j6PTYZnri1LDFIMyiPSMQMpwh1F7a7vGq7do4bycIdXnp1y6HHvr1/REWJTNRjKHGTVlkd2QxDB/ui/2nVBehPu6DuSN4WqF9jL27Gh0EeHtC42AairHl1sp07PI5iKbSzfUeCJ+sf3iUfswbFbF7Q+nsXAsKKTpNzZ9ek4sP+Vnj2HxXvoAZIEs/30sT+I4bMFNNhrupZC2g7cC+yr+D6g+cDTPOn0VZ8OXZoC0pTuICLphD93z2ONkGwPYX7jZk9Y2Mk9zQ+vJScxtZq2rbHyBP7h9I/EYKlc3lSSwp4zT4Z9Q== X-YMail-OSG: vRVHMTcVM1nkKKmi2o7f9JzZY3uTVDmp6.JLB5LhCxEzzX3O50ZyXzK0BaccBHn OmdBLziMBg4AOUlgGs9tslXqhJPeYZRnnGeQxKXugeyNZUOPmGak0zsEr_q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QpU2bOh1GP HjE0PRRGWLu78exnmF_UDLSEpNpSaF16Uyw2fJ_jRvCgh_RmzLj2_aMIU7A7ouMl6kwAk0FPsxEX Qjp_eao7LgGrZ9q2cUSXDsyMwZyqg7571Ychan5AWbfe0lGGg1rTzCHH0ft3Tjx8iCeghNd5q8hO Jg05jZdLt6rKuQbCwEe.k8UvHnBYcl98PcMYegrWID4w93KgFo8677BCfsxyQqWOJhdPqpvY83i4 syinM27xkPHQc9yV1vpi8O3XHd7adLwlfHBTi2X2LLYvsYGwdbu2OnjKkYOptNeTYY7u46uPav4W NAA0QUuTasmlMpBQNyEEXrM6DE1tbx_MVHXKESJpA16BHYLKWlVZgV4H6PGLTNT7D.OX9sKl577G jlom1 X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.gq1.yahoo.com with HTTP; Wed, 17 Feb 2021 22:26:40 +0000 Received: by smtp419.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 190f7448629f36631cf1397aa0336fb4; Wed, 17 Feb 2021 22:26:38 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: "grep -rI ... /" vs. processing of /dev/ : should "--exclude-dir /dev" be required in order to avoid /dev/? From: Mark Millard In-Reply-To: Date: Wed, 17 Feb 2021 14:26:37 -0800 Cc: freebsd-current Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Kyle Evans X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Rspamd-Queue-Id: 4Dgsrg0SbZz3pSQ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2021 22:26:43 -0000 On 2021-Feb-17, at 11:44, Kyle Evans wrote: > On Tue, Feb 16, 2021 at 7:29 PM Kyle Evans = wrote: >>=20 >> On Tue, Feb 16, 2021 at 7:23 PM Mark Millard via freebsd-current >> wrote: >>>=20 >>> I historically on occasion have done something like: >>>=20 >>> # grep -rI ... / >>>=20 >>> in order to find all instances of a text, including >>> in build trees and such. I now find that I need to >>> do something more like (using a more specific >>> example): >>>=20 >>> # grep -rI --exclude-dir /dev '#define.*__FreeBSD_version' >>>=20 >>> otherwise the grep ends up reading from the tty and waits >>> for it. Top shows, for example, >>>=20 >>> 13470 root 22 0 12848Ki 2692Ki ttyin 11 0:00 = 0.00% grep -rI #define.*__FreeBSD_version / >>>=20 >>> Is this expected? Should I have always been using >>> "--exclude-dir /dev"? What lead to the behavior >>> change? >>>=20 >>=20 >> I can't seem to find any evidence that gnugrep in base handled this >> any differently. Experimentation seems to reveal that modern gnugrep >> will skip devices unless they're explicitly named for searching >> (unless supplied a different --devices option), which does feel like = a >> good idea. >=20 > Here's my proposal: https://people.freebsd.org/~kevans/grep-rdev.diff wget, git apply, buildworld, installworld, and some quick testing: Seems to work as described in the updated man page and avoids my needing "--exclude-dir /dev" (or other alternatives) by default with the -r . I did try some explicit /dev and /dev/tty and /dev/random use, and some "no -r" variations of the -r testing. While it was just quick testing, I did not notice anything odd happening. I did do one -r for / that I let run to completion. FYI: this is based on main 3acea07c1873 as a context. In more detail: # ~/fbsd-based-on-what-freebsd-main.sh=20 merge-base: 3acea07c1873b1e4042f4a4fa8668745ee59f15b merge-base: CommitDate: 2021-02-08 19:15:21 +0000 c1845d00f818 (HEAD -> mm-src) mm-src snapshot for mm's patched build in = git context. 3acea07c1873 (pure-src) Restore the augmented strlen commentary FreeBSD FBSDFHUGE 14.0-CURRENT FreeBSD 14.0-CURRENT = mm-src-n244686-c1845d00f818 GENERIC-NODBG amd64 amd64 1400004 1400004 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)