Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Feb 2021 17:22:43 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        freebsd-current <freebsd-current@freebsd.org>
Subject:   "grep -rI ... /" vs. processing of /dev/ : should "--exclude-dir /dev" be required in order to avoid /dev/?
Message-ID:  <B822DED7-0607-47F3-8C1F-4C814D2A9EF5@yahoo.com>
References:  <B822DED7-0607-47F3-8C1F-4C814D2A9EF5.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I historically on occasion have done something like:

# grep -rI ... /

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):

# grep -rI --exclude-dir /dev '#define.*__FreeBSD_version'

otherwise the grep ends up reading from the tty and waits
for it. Top shows, for example,

13470 root         22    0  12848Ki    2692Ki ttyin   11   0:00   0.00% =
grep -rI #define.*__FreeBSD_version /

Is this expected? Should I have always been using
"--exclude-dir /dev"? What lead to the behavior
change?

(FYI: The activity is normally as root.)

I'll note that I also got a couple of other messages
first:

grep: /dev/log: Operation not supported
grep: /dev/reroot/reroot: Operation not supported by device

I do not remember getting these in the past.

The issue happens with or without the -I part of the
grep command.


The context for the above is based on main 3acea07c1873 ,
or, in more detail,

# ~/fbsd-based-on-what-freebsd-main.sh
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)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B822DED7-0607-47F3-8C1F-4C814D2A9EF5>