Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Uncertain fortune is thoroughly mastered by the equity of the calculation. -- Blaise Pascal


devel / comp.unix.shell / why is it OK for grep to find files?

SubjectAuthor
* why is it OK for grep to find files?Ed Morton
+* Re: why is it OK for grep to find files?Richard Kettlewell
|+* Re: why is it OK for grep to find files?Ed Morton
||`- Re: why is it OK for grep to find files?Richard Kettlewell
|`- Re: why is it OK for grep to find files?Ed Morton
+* Re: why is it OK for grep to find files?Chris Elvidge
|+- Re: why is it OK for grep to find files?Lew Pitcher
|`* Re: why is it OK for grep to find files?Ed Morton
| `- Re: why is it OK for grep to find files?Chris Elvidge
+* Re: why is it OK for grep to find files?Kaz Kylheku
|+- Re: why is it OK for grep to find files?Lew Pitcher
|`* Re: why is it OK for grep to find files?Ed Morton
| +* Re: why is it OK for grep to find files?John D Groenveld
| |`- Re: why is it OK for grep to find files?Kaz Kylheku
| `* Re: why is it OK for grep to find files?Richard Kettlewell
|  +* Re: why is it OK for grep to find files?Kenny McCormack
|  |+* Re: why is it OK for grep to find files?Janis Papanagnou
|  ||`* Re: why is it OK for grep to find files?Damien Wyart
|  || `* Re: why is it OK for grep to find files?Janis Papanagnou
|  ||  `* Re: why is it OK for grep to find files?Damien Wyart
|  ||   `- Re: why is it OK for grep to find files?Janis Papanagnou
|  |`* Re: why is it OK for grep to find files?Richard Kettlewell
|  | `* Re: why is it OK for grep to find files?Kenny McCormack
|  |  `- Re: why is it OK for grep to find files?Janis Papanagnou
|  `* Re: why is it OK for grep to find files?Ed Morton
|   +* Re: why is it OK for grep to find files?Richard Kettlewell
|   |+* Re: why is it OK for grep to find files?Ed Morton
|   ||+* Re: why is it OK for grep to find files?Richard Kettlewell
|   |||+* Re: why is it OK for grep to find files?Kenny McCormack
|   ||||`- Re: why is it OK for grep to find files?hymie!
|   |||`* Re: why is it OK for grep to find files?Ed Morton
|   ||| `* Re: why is it OK for grep to find files?Richard Kettlewell
|   |||  `* Re: why is it OK for grep to find files?Andy Walker
|   |||   `- Re: why is it OK for grep to find files?Janis Papanagnou
|   ||`* Re: why is it OK for grep to find files?Ben Bacarisse
|   || +* Re: why is it OK for grep to find files?Ed Morton
|   || |`* Re: why is it OK for grep to find files?Ben Bacarisse
|   || | +- Re: why is it OK for grep to find files?Janis Papanagnou
|   || | +* Re: why is it OK for grep to find files?Ed Morton
|   || | |`* Re: why is it OK for grep to find files?Ben Bacarisse
|   || | | `* Re: why is it OK for grep to find files?Ed Morton
|   || | |  `* Re: why is it OK for grep to find files?Ben Bacarisse
|   || | |   `* Re: why is it OK for grep to find files?Ed Morton
|   || | |    +* Re: why is it OK for grep to find files?Janis Papanagnou
|   || | |    |`- Re: why is it OK for grep to find files?Ed Morton
|   || | |    `* Re: why is it OK for grep to find files?Ben Bacarisse
|   || | |     `* Re: why is it OK for grep to find files?Ed Morton
|   || | |      +- Re: why is it OK for grep to find files?Kaz Kylheku
|   || | |      `* Re: why is it OK for grep to find files?Ben Bacarisse
|   || | |       `- Re: why is it OK for grep to find files?Ed Morton
|   || | `- Re: why is it OK for grep to find files?Ed Morton
|   || `* Re: why is it OK for grep to find files?Geoff Clare
|   ||  `* Re: why is it OK for grep to find files?Ben Bacarisse
|   ||   `* Re: why is it OK for grep to find files?Keith Thompson
|   ||    +* Re: why is it OK for grep to find files?Ben Bacarisse
|   ||    |`* Re: why is it OK for grep to find files?Keith Thompson
|   ||    | `- Re: why is it OK for grep to find files?Keith Thompson
|   ||    `- Re: why is it OK for grep to find files?Kaz Kylheku
|   |`- Re: why is it OK for grep to find files?Adam Funk
|   +* Re: why is it OK for grep to find files?Kaz Kylheku
|   |+* Re: why is it OK for grep to find files?Janis Papanagnou
|   ||`* Re: why is it OK for grep to find files?Kaz Kylheku
|   || `- Re: why is it OK for grep to find files?Janis Papanagnou
|   |+* Re: why is it OK for grep to find files?Computer Nerd Kev
|   ||`* Re: why is it OK for grep to find files?Javier
|   || `- Re: why is it OK for grep to find files?Christian Weisgerber
|   |`* Re: why is it OK for grep to find files?Ed Morton
|   | +- Re: why is it OK for grep to find files?Kaz Kylheku
|   | `- Re: why is it OK for grep to find files?Stan Moore
|   `* Re: why is it OK for grep to find files?Janis Papanagnou
|    `- Re: why is it OK for grep to find files?Ed Morton
+- Re: why is it OK for grep to find files?Christian Weisgerber
`- Re: why is it OK for grep to find files?Janis Papanagnou

Pages:123
why is it OK for grep to find files?

<ufblqv$1hpjc$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6674&group=comp.unix.shell#6674

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mortons...@gmail.com (Ed Morton)
Newsgroups: comp.unix.shell
Subject: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 06:40:15 -0500
Organization: A noiseless patient Spider
Lines: 68
Message-ID: <ufblqv$1hpjc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 1 Oct 2023 11:40:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e9bde01aafde9cfeef9c9c2cc50e33c7";
logging-data="1631852"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/S9fmWfrsjdge+1W2MG9qE"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:+REJuWIbNSJRgDPr9hJOTMLjBFc=
Content-Language: en-US
X-Antivirus-Status: Clean
X-Antivirus: Avast (VPS 230930-4, 9/30/2023), Outbound message
 by: Ed Morton - Sun, 1 Oct 2023 11:40 UTC

A recent thread titled "Get a list of files that contain a string"
produced an answer suggesting the OP use "grep -rl regexp" with "-l
string" being the GNU grep option to only output the file name when
"regexp" matches a string in a file, and "-r" being the GNU grep option
to recursively find files.

I'm trying to understand why it's OK for GNU grep to have options to
find files:

-d, --directories=ACTION how to handle directories;
-r, --recursive like --directories=recurse
-R, --dereference-recursive likewise, but follow all symlinks
--include=GLOB search only files that match GLOB (a file
pattern)
--exclude=GLOB skip files that match GLOB
--exclude-from=FILE skip files that match any file pattern from
FILE
--exclude-dir=GLOB skip directories that match GLOB

when traditionally "grep" exists to "g/re/p" (the "ed" commands to
Globally match a Regular Expression within files and Print the result),
the tool "find" exists to "find" files, no other text processing
commands have options to find files, and #1 in the Unix philosophy
(https://en.wikipedia.org/wiki/Unix_philosophy) is to "Make each program
do one thing well. To do a new job, build afresh rather than complicate
old programs by adding new "features"."

If grep should have options to find files then maybe they should also:

a) Give "grep" additional options to "sort" it's output, "tr"anslate
characters, "paste" results from multiple files, etc.
b) Give "sed", "awk", "tr", "cut", "paste" etc. the same options as GNU
grep now has so they can also "find" files.

I see grep commands these days that are a relatively long, complicated
mixture of options, some to find files and others to search within
files, e.g.:

grep -r --include='*.html' --include='*.php' --include='*.htm' -Fxl
'regexp' /some/path/
grep -R --include='*.{html,php,htm}' -Fxl 'regexp' /some/path

when "find ... -exec grep ... {} +":

find /some/path \( -name '*.html' -o -name '*.php' -o -name '*.htm'
\) -exec grep -Fxl 'regexp' {} +
find /some/path -regextype egrep -regex '.*\.(html|php|htm)$' -exec
grep -Fxl 'regexp' {} +

or similar would do the job about as briefly and efficiently as well as
making it easier to replace just the grep command with sed or awk
if/when the "search within files" part in future became more complex
than made sense for "grep".

So:

1) Is there some reason why the GNU folks having added options to find
files onto grep was a reasonable thing to do rather than flying in the
face of the Unix philosophy and unnecessarily complicating the interface
of grep?

2) Can we expect GUN grep to get additional options in future to do
other things that other Unix commands currently do?

3) Can we expect GNU sed, awk, etc. to also get options to find files
for consistency with GNU grep?

Ed.

Re: why is it OK for grep to find files?

<wwvsf6uo7qm.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6676&group=comp.unix.shell#6676

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 01 Oct 2023 13:19:29 +0100
Organization: terraraq NNTP server
Message-ID: <wwvsf6uo7qm.fsf@LkoBDZeT.terraraq.uk>
References: <ufblqv$1hpjc$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="139131"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:67fh+iAbf2DOdZYoVejYd2Hnkws=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Sun, 1 Oct 2023 12:19 UTC

Ed Morton <mortonspam@gmail.com> writes:
> 1) Is there some reason why the GNU folks having added options to find
> files onto grep was a reasonable thing to do rather than flying in the
> face of the Unix philosophy and unnecessarily complicating the
> interface of grep?

I expect they thought they would be useful; if so they were right.

You don’t have to use them if you don’t like them...

--
https://www.greenend.org.uk/rjk/

Re: why is it OK for grep to find files?

<ufbsn2$1j22k$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6677&group=comp.unix.shell#6677

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chr...@mshome.net (Chris Elvidge)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 14:37:37 +0100
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <ufbsn2$1j22k$1@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 1 Oct 2023 13:37:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0b4e6ab1038553831fba67f375fa8883";
logging-data="1673300"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19u6zV6KhszwhWQ6Z4XzQTRbNWyKTNrh8I="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
Thunderbird/52.2.1 Lightning/5.4
Cancel-Lock: sha1:wwtHCBIGMDYFutJ5+MaV9KetAjw=
In-Reply-To: <ufblqv$1hpjc$1@dont-email.me>
Content-Language: en-GB
 by: Chris Elvidge - Sun, 1 Oct 2023 13:37 UTC

On 01/10/2023 12:40, Ed Morton wrote:
> 1) Is there some reason why the GNU folks having added options to find
> files onto grep was a reasonable thing to do rather than flying in the
> face of the Unix philosophy and unnecessarily complicating the interface
> of grep?

Grep doesn't find files; the shell does that. Grep only searches the
files given for the "regular expression".

SYNOPSIS
grep [OPTION...] PATTERNS [FILE...]
grep [OPTION...] -e PATTERNS ... [FILE...]
grep [OPTION...] -f PATTERN_FILE ... [FILE...]

DESCRIPTION
grep searches for PATTERNS in each FILE.

--
Chris Elvidge, England
THE PRINCIPAL'S TOUPEE IS NOT A FRISBEE

Re: why is it OK for grep to find files?

<ufbu6o$1ikln$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6678&group=comp.unix.shell#6678

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 14:03:04 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 59
Message-ID: <ufbu6o$1ikln$1@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me> <ufbsn2$1j22k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 1 Oct 2023 14:03:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c168305db82633799d11379ee29b8f7a";
logging-data="1659575"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/s+QjqHz/TyIx3ad2+btZbZmrcnXZHlA0="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:iVDMm8OMe8vOX2zIXTYjoupj0jQ=
 by: Lew Pitcher - Sun, 1 Oct 2023 14:03 UTC

On Sun, 01 Oct 2023 14:37:37 +0100, Chris Elvidge wrote:

> On 01/10/2023 12:40, Ed Morton wrote:
>> 1) Is there some reason why the GNU folks having added options to find
>> files onto grep was a reasonable thing to do rather than flying in the
>> face of the Unix philosophy and unnecessarily complicating the
>> interface of grep?
>
> Grep doesn't find files; the shell does that. Grep only searches the
> files given for the "regular expression".

Oh???

>
> SYNOPSIS
> grep [OPTION...] PATTERNS [FILE...]
> grep [OPTION...] -e PATTERNS ... [FILE...] grep [OPTION...] -f
> PATTERN_FILE ... [FILE...]
>
> DESCRIPTION
> grep searches for PATTERNS in each FILE.

GREP(1) General Commands Manual GREP(1)

NAME
grep, egrep, fgrep - print lines matching a pattern

SYNOPSIS
grep [OPTIONS] PATTERN [FILE...]
grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]

...

File and Directory Selection

...

-r, --recursive
Read all files under each directory, recursively, following
symbolic links only if they are on the command line. Note
that if no file operand is given, grep searches the working
directory. This is equivalent to the -d recurse option.
....

BUGS
Reporting Bugs
Email bug reports to the bug-reporting address
<bug-grep@gnu.org>. An email archive
<http://lists.gnu.org/mailman/listinfo/bug-grep>
and a bug tracker
<http://debbugs.gnu.org/cgi/pkgreport.cgi?package=grep>
are available.

--
Lew Pitcher
"In Skills We Trust"

Re: why is it OK for grep to find files?

<ufc0j2$1jlnk$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6679&group=comp.unix.shell#6679

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mortons...@gmail.com (Ed Morton)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 09:43:46 -0500
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <ufc0j2$1jlnk$1@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me>
<wwvsf6uo7qm.fsf@LkoBDZeT.terraraq.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 1 Oct 2023 14:43:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e9bde01aafde9cfeef9c9c2cc50e33c7";
logging-data="1693428"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YfFQf7zDrf/W+Bw/Zr2Ve"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:e2RawRMZSCIDCsKUyT8zSt+oUbY=
In-Reply-To: <wwvsf6uo7qm.fsf@LkoBDZeT.terraraq.uk>
X-Antivirus-Status: Clean
Content-Language: en-US
X-Antivirus: Avast (VPS 231001-4, 10/1/2023), Outbound message
 by: Ed Morton - Sun, 1 Oct 2023 14:43 UTC

On 10/1/2023 7:19 AM, Richard Kettlewell wrote:
> Ed Morton <mortonspam@gmail.com> writes:
>> 1) Is there some reason why the GNU folks having added options to find
>> files onto grep was a reasonable thing to do rather than flying in the
>> face of the Unix philosophy and unnecessarily complicating the
>> interface of grep?
>
> I expect they thought they would be useful; if so they were right.

Something being useful is a long way from being the only criteria for
adding it to a command. Finding files would be useful for awk, sed,
sort, paste, and every other command that operates on files so by that
criteria all commands should have options to find files in addition to
their existing options. Sorting output would be useful for all commands
that operate on text files too so that "it's useful" criteria all
commands should have options to sort content in addition to their
existing options. Down that path lies the conclusion we should just have
1 command with all options to do everything that all existing commands
do since everything is useful.

>
> You don’t have to use them if you don’t like them...
>

But I do have to deal with existing software that uses them, I don't
have the luxury of pretending they don't exist.

Ed.

Re: why is it OK for grep to find files?

<ufc0rp$1jlnk$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6680&group=comp.unix.shell#6680

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mortons...@gmail.com (Ed Morton)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 09:48:25 -0500
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <ufc0rp$1jlnk$2@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me> <ufbsn2$1j22k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 1 Oct 2023 14:48:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e9bde01aafde9cfeef9c9c2cc50e33c7";
logging-data="1693428"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ysAp12NmnqZhXfmueF8Hu"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:A/MVE1OnWaHZY8TXH8p2VQhZYlM=
X-Antivirus: Avast (VPS 231001-4, 10/1/2023), Outbound message
X-Antivirus-Status: Clean
In-Reply-To: <ufbsn2$1j22k$1@dont-email.me>
Content-Language: en-US
 by: Ed Morton - Sun, 1 Oct 2023 14:48 UTC

On 10/1/2023 8:37 AM, Chris Elvidge wrote:
> On 01/10/2023 12:40, Ed Morton wrote:
>> 1) Is there some reason why the GNU folks having added options to find
>> files onto grep was a reasonable thing to do rather than flying in the
>> face of the Unix philosophy and unnecessarily complicating the
>> interface of grep?
>
> Grep doesn't find files; the shell does that. Grep only searches the
> files given for the "regular expression".
>
> SYNOPSIS
>        grep [OPTION...] PATTERNS [FILE...]
>        grep [OPTION...] -e PATTERNS ... [FILE...]
>        grep [OPTION...] -f PATTERN_FILE ... [FILE...]
>
> DESCRIPTION
>        grep searches for PATTERNS in each FILE.
>
>

I'm surprised to see you say that since it was your recent answer at
https://groups.google.com/g/comp.unix.shell/c/9mFNQ27MI0A/m/zwGln8V6AAAJ:

> Forget find, use grep -rl (or -Rl) (recursive, list)

where `-r` is the option to recursively find files, that inspired me to
start this thread.

Ed.

Re: why is it OK for grep to find files?

<wwvpm1yxt4e.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6681&group=comp.unix.shell#6681

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 01 Oct 2023 16:25:05 +0100
Organization: terraraq NNTP server
Message-ID: <wwvpm1yxt4e.fsf@LkoBDZeT.terraraq.uk>
References: <ufblqv$1hpjc$1@dont-email.me>
<wwvsf6uo7qm.fsf@LkoBDZeT.terraraq.uk> <ufc0j2$1jlnk$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="141700"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:E59Aq+a1woEcavKHybCcINHp4Tc=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Sun, 1 Oct 2023 15:25 UTC

Ed Morton <mortonspam@gmail.com> writes:
> On 10/1/2023 7:19 AM, Richard Kettlewell wrote:
>> Ed Morton <mortonspam@gmail.com> writes:
>>> 1) Is there some reason why the GNU folks having added options to find
>>> files onto grep was a reasonable thing to do rather than flying in the
>>> face of the Unix philosophy and unnecessarily complicating the
>>> interface of grep?
>> I expect they thought they would be useful; if so they were right.
>
> Something being useful is a long way from being the only criteria for
> adding it to a command.

That’s very situational. For a volunteer “useful and fun to do” might be
sufficent, for example.

--
https://www.greenend.org.uk/rjk/

Re: why is it OK for grep to find files?

<ufc8fj$1lf86$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6682&group=comp.unix.shell#6682

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chr...@mshome.net (Chris Elvidge)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 17:58:26 +0100
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <ufc8fj$1lf86$1@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me> <ufbsn2$1j22k$1@dont-email.me>
<ufc0rp$1jlnk$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 1 Oct 2023 16:58:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0b4e6ab1038553831fba67f375fa8883";
logging-data="1752326"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+iFSidZ0B1PitQrbC5z+Z0isccpB2LOMc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
Thunderbird/52.2.1 Lightning/5.4
Cancel-Lock: sha1:OyiVWGMOrxHtmKq60KHv+6VRKpg=
In-Reply-To: <ufc0rp$1jlnk$2@dont-email.me>
Content-Language: en-GB
 by: Chris Elvidge - Sun, 1 Oct 2023 16:58 UTC

On 01/10/2023 15:48, Ed Morton wrote:
> On 10/1/2023 8:37 AM, Chris Elvidge wrote:
>> On 01/10/2023 12:40, Ed Morton wrote:
>>> 1) Is there some reason why the GNU folks having added options to
>>> find files onto grep was a reasonable thing to do rather than flying
>>> in the face of the Unix philosophy and unnecessarily complicating the
>>> interface of grep?
>>
>> Grep doesn't find files; the shell does that. Grep only searches the
>> files given for the "regular expression".
>>
>> SYNOPSIS
>> grep [OPTION...] PATTERNS [FILE...]
>> grep [OPTION...] -e PATTERNS ... [FILE...]
>> grep [OPTION...] -f PATTERN_FILE ... [FILE...]
>>
>> DESCRIPTION
>> grep searches for PATTERNS in each FILE.
>>
>>
>
> I'm surprised to see you say that since it was your recent answer at
> https://groups.google.com/g/comp.unix.shell/c/9mFNQ27MI0A/m/zwGln8V6AAAJ:
>
>> Forget find, use grep -rl (or -Rl) (recursive, list)
>
> where `-r` is the option to recursively find files, that inspired me to
> start this thread.
>
> Ed.

OK. Perhaps wrong terminology.

[FILE...] is a list of files - could be * (all files) - shell expands it
to the list of files.

PATTERNS may be a straight character string or a regular expression (see
what I said above) or several, or read from a file.

-R/-r = follow the list of files into subdirectories (doesn't do this by
default)

Of course this has the effect of finding files in the list containing
the pattern. If the list is *, all files are searched.

--
Chris Elvidge, England
I AM SO VERY TIRED

Re: why is it OK for grep to find files?

<20231001095145.664@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6683&group=comp.unix.shell#6683

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 17:02:44 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <20231001095145.664@kylheku.com>
References: <ufblqv$1hpjc$1@dont-email.me>
Injection-Date: Sun, 1 Oct 2023 17:02:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ee44f205ccae354c39f7ae203d1e98c0";
logging-data="1755763"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Ufov8MzLavYnJ+TdUOR5Fk0uYstCHSIk="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:Vdp+iKfMrYB1Fex+6C3eizrfGtE=
 by: Kaz Kylheku - Sun, 1 Oct 2023 17:02 UTC

On 2023-10-01, Ed Morton <mortonspam@gmail.com> wrote:
> A recent thread titled "Get a list of files that contain a string"
> produced an answer suggesting the OP use "grep -rl regexp" with "-l
> string" being the GNU grep option to only output the file name when
> "regexp" matches a string in a file, and "-r" being the GNU grep option
> to recursively find files.
>
> I'm trying to understand why it's OK for GNU grep to have options to
> find files:

People often need to recursively grep a tree of files. They do it
interactively.

Using find together with a flat grep is annoyingly verbose for the task,
like:

find . -type f -exec grep foo {} /dev/null \;

Remember your /dev/null because grep behaves differently with one
file argument: won't print the file name.

Each user would end up writing a function or alias for this.

GNU Bash has a ** glob pattern (double star) which can replace uses
of find, and can potentially run into environmental passing limits
if used like this:

grep -l foo **/*.c

If the expansion is large you need either xargs, which has problems
with spaces in file names withtout GNU extensions, or write a loop:

for x in **/*.c; do grep -l foo "$x" /dev/null; done

Also an annoying mouthful for something you need often.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: why is it OK for grep to find files?

<ufcar1$1ikln$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6684&group=comp.unix.shell#6684

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 17:38:42 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 35
Message-ID: <ufcar1$1ikln$2@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 1 Oct 2023 17:38:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c168305db82633799d11379ee29b8f7a";
logging-data="1659575"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3+clDhUDG1AS1HOlXOPs+Hxeax9emtio="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:Ae6nVBtflsdeKlTJ4guM5TUlzzQ=
 by: Lew Pitcher - Sun, 1 Oct 2023 17:38 UTC

On Sun, 01 Oct 2023 17:02:44 +0000, Kaz Kylheku wrote:

> On 2023-10-01, Ed Morton <mortonspam@gmail.com> wrote:
>> A recent thread titled "Get a list of files that contain a string"
>> produced an answer suggesting the OP use "grep -rl regexp" with "-l
>> string" being the GNU grep option to only output the file name when
>> "regexp" matches a string in a file, and "-r" being the GNU grep option
>> to recursively find files.
>>
>> I'm trying to understand why it's OK for GNU grep to have options to
>> find files:
>
> People often need to recursively grep a tree of files. They do it
> interactively.
>
> Using find together with a flat grep is annoyingly verbose for the task,
> like:
>
> find . -type f -exec grep foo {} /dev/null \;
>
> Remember your /dev/null because grep behaves differently with one file
> argument: won't print the file name.

Unless you give grep(1) the -l argument[1]:
find . -type f -exec grep -l foo {} \;

[1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html

[snip]

HTH
--
Lew Pitcher
"In Skills We Trust"

Re: why is it OK for grep to find files?

<slrnuhjeuk.1h9r.naddy@lorvorc.mips.inka.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6685&group=comp.unix.shell#6685

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
From: nad...@mips.inka.de (Christian Weisgerber)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 18:35:00 -0000 (UTC)
Message-ID: <slrnuhjeuk.1h9r.naddy@lorvorc.mips.inka.de>
References: <ufblqv$1hpjc$1@dont-email.me>
Injection-Date: Sun, 1 Oct 2023 18:35:00 -0000 (UTC)
Injection-Info: lorvorc.mips.inka.de; posting-host="localhost:::1";
logging-data="50492"; mail-complaints-to="usenet@mips.inka.de"
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Christian Weisgerber - Sun, 1 Oct 2023 18:35 UTC

On 2023-10-01, Ed Morton <mortonspam@gmail.com> wrote:

> I'm trying to understand why it's OK for GNU grep to have options to
> find files:

It all started when people added the -C flag for columnized output
to ls(1) and enabled it by default if stdout was a tty--instead of
manually invoking "ls | column" as God intended...

--
Christian "naddy" Weisgerber naddy@mips.inka.de

Re: why is it OK for grep to find files?

<ufcmsa$2gkvp$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6686&group=comp.unix.shell#6686

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 23:04:10 +0200
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <ufcmsa$2gkvp$1@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 1 Oct 2023 21:04:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2be48219745aaa63cef7b5b0668ccdc2";
logging-data="2642937"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+shFjJd5CAohSFnEA/5VLR"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:9MEQB2I7KixnstR/Pu29n2nOUQg=
In-Reply-To: <ufblqv$1hpjc$1@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Sun, 1 Oct 2023 21:04 UTC

On 01.10.2023 13:40, Ed Morton wrote:
> A recent thread titled "Get a list of files that contain a string"
> produced an answer suggesting the OP use "grep -rl regexp" with "-l
> string" being the GNU grep option to only output the file name when
> "regexp" matches a string in a file, and "-r" being the GNU grep option
> to recursively find files.
>
> I'm trying to understand why it's OK for GNU grep to have options to
> find files: [...]

When I read that other post's statement
"Forget find, use grep -rl (or -Rl) (recursive, list)"
I had some (partly similar) thoughts. That's why (in my post) I
emphasized my wording to distinguish the cases by the necessity
to "find" files or not. (Has that wording triggered your post?)

My random thoughts (in no particular order or any valuation) were...
a) Do Unix tools start implementing each function (like DOS does e.g.
with expansion of * and other "wildcards" in each tool vs. shell)
duplicated in every program now, just for (sort of) "convenience"?
Why is there a deviation from the "Separation of Duties" principle?
b) Pipe expressions may grow, it may be simpler to use one process.
Modern xargs or find syntaxes support efficient processing.
Implementing it in 'grep' may simplify logic in certain cases.
There are already deviations from the "Separation of Duties" in
other tools; see 'ls' with its sort extensions and GNU 'ls' yet
with more sort options and a lot other options.
c) Which program shall at what stage do the directory tree walk?
We have a specialized 'find' (or a more powerful/modern 'tw').
We have it supported as ** in newer shell (ksh, zsh, bash)
(but exec buffer limit might pop in here, so safe options are
desirable, or using it in safe ways with built-ins only; ksh).
Now we see it in 'grep'. Will we see it in other programs as well.
(See point a)
d) It is non-standard.
Many folks don't care about standards, they want functionality
(provided by tools that are sometimes designed by "featurities").
It will probably result in a wild proliferation of software versions
(as seen in the public domain sector).
e) Is it an ideological issue? Should I really care?
If it's no burden (in space or time complexity) but helps in some
cases, why not use it?

Janis

Re: why is it OK for grep to find files?

<ufcs86$2hl1e$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6687&group=comp.unix.shell#6687

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mortons...@gmail.com (Ed Morton)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 17:35:50 -0500
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <ufcs86$2hl1e$1@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me>
<wwvsf6uo7qm.fsf@LkoBDZeT.terraraq.uk>
<op.2b47unn7a3w0dxdave@hodgins.homeip.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 1 Oct 2023 22:35:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0f9fd4aa45e9546505ecf15cc88bb8be";
logging-data="2675758"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18MOA2o8udHaQ8Jgcn9T1et"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:s2we7lUYuKyTRsfAB0KoPQ1ZYHs=
X-Antivirus: Avast (VPS 231001-6, 10/1/2023), Outbound message
In-Reply-To: <op.2b47unn7a3w0dxdave@hodgins.homeip.net>
X-Antivirus-Status: Clean
Content-Language: en-US
 by: Ed Morton - Sun, 1 Oct 2023 22:35 UTC

On 10/1/2023 10:55 AM, David W. Hodgins wrote:
> On Sun, 01 Oct 2023 08:19:29 -0400, Richard Kettlewell
> <invalid@invalid.invalid> wrote:
>
>> Ed Morton <mortonspam@gmail.com> writes:
>>> 1) Is there some reason why the GNU folks having added options to find
>>> files onto grep was a reasonable thing to do rather than flying in the
>>> face of the Unix philosophy and unnecessarily complicating the
>>> interface of grep?
>>
>> I expect they thought they would be useful; if so they were right.
>>
>> You don’t have to use them if you don’t like them...
>
> The find command is used to find files within a directory tree based on
> the file name.
>
> While find can be used to invoke grep on each file it returns, when
> searching
> for text in all files in a directory tree, or in a list of files (as
> returned
> by shell expansion), it's more efficient to only invoke grep once and let
> it do all parts of the searching.

find ... -exec grep 'regexp' {} +

doesn't call grep once per file, it calls grep on groups of files so as
to not exceed ARG_MAX for each group.

So, yes it's probably a bit more efficient to call grep once on all
files but not enough so as to justify given grep it's own set of
file-finding arguments and if it did make sense for grep then it'd also
make sense for awk, sed, and every other tool that runs on text files
(or even giving find options to grep in files instead of the other way
around!).

Ed.

>
> Regards, Dave Hodgins

Re: why is it OK for grep to find files?

<ufct99$2hrnj$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6688&group=comp.unix.shell#6688

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mortons...@gmail.com (Ed Morton)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Sun, 1 Oct 2023 17:53:29 -0500
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <ufct99$2hrnj$1@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 1 Oct 2023 22:53:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0f9fd4aa45e9546505ecf15cc88bb8be";
logging-data="2682611"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18iXgQUigOKmXs1MxTjedeB"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:oJB7wA2UcUdV/5Ono2qrYuTtC6g=
X-Antivirus-Status: Clean
Content-Language: en-US
X-Antivirus: Avast (VPS 231001-6, 10/1/2023), Outbound message
In-Reply-To: <20231001095145.664@kylheku.com>
 by: Ed Morton - Sun, 1 Oct 2023 22:53 UTC

On 10/1/2023 12:02 PM, Kaz Kylheku wrote:
> On 2023-10-01, Ed Morton <mortonspam@gmail.com> wrote:
>> A recent thread titled "Get a list of files that contain a string"
>> produced an answer suggesting the OP use "grep -rl regexp" with "-l
>> string" being the GNU grep option to only output the file name when
>> "regexp" matches a string in a file, and "-r" being the GNU grep option
>> to recursively find files.
>>
>> I'm trying to understand why it's OK for GNU grep to have options to
>> find files:
>
> People often need to recursively grep a tree of files. They do it
> interactively.

I find myself writing find+grep commands much less frequently than
find+sed or find+awk but YMMV I suppose.

> Using find together with a flat grep is annoyingly verbose for the task,
> like:
>
> find . -type f -exec grep foo {} /dev/null \;
>
> Remember your /dev/null because grep behaves differently with one
> file argument: won't print the file name.

If you're using GNU grep (which you'd need for the file-finding options)
give it the `-H` argument and it'll print file names as well as the
matching string without having to add /dev/null:

find . -type f -exec grep -H foo {} +

I changed the `\;` to `+` so grep gets called on multiple files at a
time instead of one at a time.

>
> Each user would end up writing a function or alias for this.
>
> GNU Bash has a ** glob pattern (double star) which can replace uses
> of find, and can potentially run into environmental passing limits
> if used like this:
>
> grep -l foo **/*.c
>
> If the expansion is large you need either xargs, which has problems
> with spaces in file names withtout GNU extensions, or write a loop:
>
> for x in **/*.c; do grep -l foo "$x" /dev/null; done
>
> Also an annoying mouthful for something you need often.

sed, awk, and every other Unix tool have the same behavior, writing
`find . -type f -exec grep -l foo {} +` is just not a big deal, avoids
the problems you mentioned with "**/*.c" and "xargs", and it's good for
people to know how to find files with "find" for when they need to use
any other Unix tool instead of grep on the resultant files.

So I don't see any of that as justifying adding a bunch of options to
grep to do something other than it's primary purpose of g/re/p and
making it different from all other text processing tools in that regard.

Ed.

Re: why is it OK for grep to find files?

<nTmSM.220509$_Lv6.95051@fx12.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6689&group=comp.unix.shell#6689

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
From: groenv...@acm.org (John D Groenveld)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com> <ufct99$2hrnj$1@dont-email.me>
Organization: Groenveld.US
Lines: 14
Message-ID: <nTmSM.220509$_Lv6.95051@fx12.iad>
X-Complaints-To: abuse@frugalusenet.com
NNTP-Posting-Date: Sun, 01 Oct 2023 23:01:39 UTC
Date: Sun, 01 Oct 2023 23:01:39 GMT
X-Received-Bytes: 999
 by: John D Groenveld - Sun, 1 Oct 2023 23:01 UTC

In article <ufct99$2hrnj$1@dont-email.me>,
Ed Morton <mortonspam@gmail.com> wrote:
>If you're using GNU grep (which you'd need for the file-finding options)
>give it the `-H` argument and it'll print file names as well as the
>matching string without having to add /dev/null:

illumos, FreeBSD and OpenBSD grep(1) also include -H:
<URL:https://illumos.org/man/1/grep>
<URL:https://man.freebsd.org/cgi/man.cgi?grep(1)>
<URL:https://man.openbsd.org/grep>

YMMV
John
groenveld@acm.org

Re: why is it OK for grep to find files?

<20231001211832.556@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6690&group=comp.unix.shell#6690

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Mon, 2 Oct 2023 04:21:05 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <20231001211832.556@kylheku.com>
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com>
<ufct99$2hrnj$1@dont-email.me> <nTmSM.220509$_Lv6.95051@fx12.iad>
Injection-Date: Mon, 2 Oct 2023 04:21:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ccd68edf4853061598e9b531b7ba0498";
logging-data="2925285"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18T9qOpdx+Gpd2UdiBI3UqF5B6jwfuFL98="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:7W1Ha2oRHyrXuD+4XSQAjJMBSTk=
 by: Kaz Kylheku - Mon, 2 Oct 2023 04:21 UTC

On 2023-10-01, John D Groenveld <groenveld@acm.org> wrote:
> In article <ufct99$2hrnj$1@dont-email.me>,
> Ed Morton <mortonspam@gmail.com> wrote:
>>If you're using GNU grep (which you'd need for the file-finding options)
>>give it the `-H` argument and it'll print file names as well as the
>>matching string without having to add /dev/null:
>
> illumos, FreeBSD and OpenBSD grep(1) also include -H:
><URL:https://illumos.org/man/1/grep>
><URL:https://man.freebsd.org/cgi/man.cgi?grep(1)>
><URL:https://man.openbsd.org/grep>

Looking at just the OpenBSD one at the bottom, I see also that it
includes a -R recursive option.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: why is it OK for grep to find files?

<wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6691&group=comp.unix.shell#6691

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Mon, 02 Oct 2023 08:09:53 +0100
Organization: terraraq NNTP server
Message-ID: <wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com>
<ufct99$2hrnj$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="8034"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:nLtbreh5TB2vTp8wzqN60stvwzw=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Mon, 2 Oct 2023 07:09 UTC

Ed Morton <mortonspam@gmail.com> writes:
> So I don't see any of that as justifying adding a bunch of options to
> grep to do something other than it's primary purpose of g/re/p and
> making it different from all other text processing tools in that
> regard.

Why do you think it needs justifying? It’s their code, they can add
whatever they like to it.

--
https://www.greenend.org.uk/rjk/

Re: why is it OK for grep to find files?

<ufe2jg$1kh2s$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6692&group=comp.unix.shell#6692

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Mon, 2 Oct 2023 09:30:24 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <ufe2jg$1kh2s$1@news.xmission.com>
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com> <ufct99$2hrnj$1@dont-email.me> <wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>
Injection-Date: Mon, 2 Oct 2023 09:30:24 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1721436"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Mon, 2 Oct 2023 09:30 UTC

In article <wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>,
Richard Kettlewell <invalid@invalid.invalid> wrote:
>Ed Morton <mortonspam@gmail.com> writes:
>> So I don't see any of that as justifying adding a bunch of options to
>> grep to do something other than it's primary purpose of g/re/p and
>> making it different from all other text processing tools in that
>> regard.
>
>Why do you think it needs justifying? Its their code, they can add
>whatever they like to it.

1) "Justifying" was, perhaps, too strong of a word. Obviously, there's no
need to do so, in a strict, legalistic sense. Though (total aside coming
up), it reminds me of when lawyers get uppity when they see computer
messages like "illegal instruction" - when they know that, in their terms
and frame of reference, there's nothing illegal about it.

2) There will always be a tension between wanting programs to be as useful
as possible and being in conformance with the idea that there should be
limits on functionality (i.e., the concept of "feature creep"). The
standard cliche on this topic is "All programs expand to eventually include
email". We will know we've lost the battle when grep expands to the point
where it can email you the results of the search.

Anyway, this tension always exists and almost always functionality wins
out over conservatism. In the specific case under discussion (recursive
searching in grep), it is pretty common that when you are introducing grep
to a newuser, one of their first comments/requests will be "And, of course
I want to search all the files (meaning, all the subdirectories and files)
So, of course, your tool will do that, right?"

And, finally, let me add:

3) I personally find the "find" command archaic and hard to use (meaning:
If it were being designed today, it wouldn't be like it is). From a
usability standpoint, it is much better to be able to just include "-r" on
the grep command line, than to have to write out a long, ugly "find"
invocation.

--
To my knowledge, Jacob Navia is not a Christian.

- Rick C Hodgin -

Re: why is it OK for grep to find files?

<ufe87f$2th4o$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6693&group=comp.unix.shell#6693

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Mon, 2 Oct 2023 13:06:22 +0200
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <ufe87f$2th4o$1@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com>
<ufct99$2hrnj$1@dont-email.me> <wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>
<ufe2jg$1kh2s$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 2 Oct 2023 11:06:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f99dc9dfe98ed145016765225d6700f6";
logging-data="3064984"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uZL/BmTExAC4TsGFs6K2r"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:Y3yPhWkIOsPG5fZWr0XGkqhRyCc=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <ufe2jg$1kh2s$1@news.xmission.com>
 by: Janis Papanagnou - Mon, 2 Oct 2023 11:06 UTC

On 02.10.2023 11:30, Kenny McCormack wrote:
> And, finally, let me add:
>
> 3) I personally find the "find" command archaic and hard to use (meaning:
> If it were being designed today, it wouldn't be like it is). From a
> usability standpoint, it is much better to be able to just include "-r" on
> the grep command line, than to have to write out a long, ugly "find"
> invocation.

What about the 'tw' (tree walk) command from AT&T; unfortunately I
cannot find it online at the moment. Basic usage is simple (less
"archaic" syntax) but it can get as complicated as a programming
language with complex actions possible.

I only found a man page lying around on my disk and put it here
http://volatile.gridbug.de/tw.out" rel="nofollow" target="_blank">http://volatile.gridbug.de/tw.out
With usage examples at the bottom of that file.
I found also an old Linux binary from 2006 that I put there
http://volatile.gridbug.de/tw
(Haven't used it regularly, though; was used to archaic 'find'.)

Janis

Re: why is it OK for grep to find files?

<ufebb1$2ucbq$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6695&group=comp.unix.shell#6695

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mortons...@gmail.com (Ed Morton)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Mon, 2 Oct 2023 06:59:29 -0500
Organization: A noiseless patient Spider
Lines: 57
Message-ID: <ufebb1$2ucbq$1@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com>
<ufct99$2hrnj$1@dont-email.me> <wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 2 Oct 2023 11:59:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0f9fd4aa45e9546505ecf15cc88bb8be";
logging-data="3092858"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+T1k2c1uz+81WrUaafQN1X"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:BorUv3ZngtnIHx/+y3ye6hPb1no=
Content-Language: en-US
In-Reply-To: <wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>
X-Antivirus: Avast (VPS 231002-0, 10/1/2023), Outbound message
X-Antivirus-Status: Clean
 by: Ed Morton - Mon, 2 Oct 2023 11:59 UTC

On 10/2/2023 2:09 AM, Richard Kettlewell wrote:
> Ed Morton <mortonspam@gmail.com> writes:
>> So I don't see any of that as justifying adding a bunch of options to
>> grep to do something other than it's primary purpose of g/re/p and
>> making it different from all other text processing tools in that
>> regard.
>
> Why do you think it needs justifying? It’s their code, they can add
> whatever they like to it.
>

The GNU people added functionality to grep in a way that is
contradictory to the Unix philosophy and makes it inconsistent with all
other text processing tools.

So far the only suggestion I've heard for why they did that is so people
could do:

grep -r 'regexp'

instead of:

find . -type f -exec grep -H 'regexp' {} +

which saves us about 20 simple, common characters over find+grep but
does nothing for find+awk, find+sed, etc.

If reducing how much typing we need to do for that was their only goal,
they could have introduced a separate tool named something like "ftf"
that does the equivalent of "Find -Type F" but takes the same arguments
they added to grep for finding files if they feel those are better than
the equivalent "find" arge, and calls whatever command is also provided
in the args with the resulting files, and then we could do:

ftf grep 'regexp'

which is about the same number of chars as using "-r", is consistent
with the Unix philosophy, and has the huge benefit that we could use it
for every other text processing tool too:

ftf sed '...'
ftf awk '...'
etc.

I assume they didn't spend their time and effort
designing/coding/testing/documenting/supporting the grep functionality
for finding files on a whim and I think it's reasonable to ask what the
rationale was for doing that, especially when they could have either
done nothing (20 simple chars - who cares?) or introduced a far more
generally useful separate tool for the purpose. Of the possibilities
they had, the one they chose to implement is concerning for other
potential changes that they might introduce in future.

Ed.

Re: why is it OK for grep to find files?

<651ab6df$0$7778$426a74cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6696&group=comp.unix.shell#6696

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-b.proxad.net!nnrp3-1.free.fr!not-for-mail
From: damien.w...@free.fr (Damien Wyart)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Organization: Serveur de News Free
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com>
<ufct99$2hrnj$1@dont-email.me> <wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>
<ufe2jg$1kh2s$1@news.xmission.com> <ufe87f$2th4o$1@dont-email.me>
Date: Mon, 02 Oct 2023 14:26:07 +0200
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50
MIME-Version: 1.0
Content-Type: text/plain
Lines: 10
Message-ID: <651ab6df$0$7778$426a74cc@news.free.fr>
NNTP-Posting-Date: 02 Oct 2023 14:26:07 CEST
NNTP-Posting-Host: 81.249.163.139
X-Trace: 1696249567 news-2.free.fr 7778 81.249.163.139:59904
X-Complaints-To: abuse@proxad.net
 by: Damien Wyart - Mon, 2 Oct 2023 12:26 UTC

* Janis Papanagnou <janis_papanagnou+ng@hotmail.com> in comp.unix.shell:
> What about the 'tw' (tree walk) command from AT&T; unfortunately I cannot find
> it online at the moment. Basic usage is simple (less "archaic" syntax) but it
> can get as complicated as a programming language with complex actions possible.

I found this https://github.com/att/ast/tree/master/src/cmd/tw
but it seems some work would be needed to compile it on a recent Linux.

--
DW

Re: why is it OK for grep to find files?

<ufeg41$2v867$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6697&group=comp.unix.shell#6697

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Mon, 2 Oct 2023 15:21:03 +0200
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <ufeg41$2v867$1@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com>
<ufct99$2hrnj$1@dont-email.me> <wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>
<ufe2jg$1kh2s$1@news.xmission.com> <ufe87f$2th4o$1@dont-email.me>
<651ab6df$0$7778$426a74cc@news.free.fr>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 2 Oct 2023 13:21:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="796cc10ffb39a5a154edb50580b216dd";
logging-data="3121351"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19AqoZkYmnYFSjSLyRzkmxE"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:zTGT2fOowLconMHi5a6xyQx+tRs=
In-Reply-To: <651ab6df$0$7778$426a74cc@news.free.fr>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Mon, 2 Oct 2023 13:21 UTC

On 02.10.2023 14:26, Damien Wyart wrote:
> * Janis Papanagnou <janis_papanagnou+ng@hotmail.com> in comp.unix.shell:
>> What about the 'tw' (tree walk) command from AT&T; unfortunately I cannot find
>> it online at the moment. Basic usage is simple (less "archaic" syntax) but it
>> can get as complicated as a programming language with complex actions possible.
>
> I found this https://github.com/att/ast/tree/master/src/cmd/tw

(I cannot even get or clone it from here.)

> but it seems some work would be needed to compile it on a recent Linux.

The AST software tools had their own build process, so probably you
have to get the whole AST tree with its build-system to create it.

Janis

Re: why is it OK for grep to find files?

<651ac807$0$8238$426a74cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6699&group=comp.unix.shell#6699

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed1-b.proxad.net!nnrp4-1.free.fr!not-for-mail
From: damien.w...@free.fr (Damien Wyart)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Organization: Serveur de News Free
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com>
<ufct99$2hrnj$1@dont-email.me> <wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>
<ufe2jg$1kh2s$1@news.xmission.com> <ufe87f$2th4o$1@dont-email.me>
<651ab6df$0$7778$426a74cc@news.free.fr> <ufeg41$2v867$1@dont-email.me>
Date: Mon, 02 Oct 2023 15:39:19 +0200
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50
MIME-Version: 1.0
Content-Type: text/plain
Lines: 10
Message-ID: <651ac807$0$8238$426a74cc@news.free.fr>
NNTP-Posting-Date: 02 Oct 2023 15:39:19 CEST
NNTP-Posting-Host: 81.249.163.139
X-Trace: 1696253959 news-1.free.fr 8238 81.249.163.139:44590
X-Complaints-To: abuse@proxad.net
 by: Damien Wyart - Mon, 2 Oct 2023 13:39 UTC

> > I found this https://github.com/att/ast/tree/master/src/cmd/tw

* Janis Papanagnou <janis_papanagnou+ng@hotmail.com> in comp.unix.shell:
> (I cannot even get or clone it from here.)

Sorry, just wanted to point out "tw" in a precise way.
The root of the repository is here: https://github.com/att/ast

--
DW

Re: why is it OK for grep to find files?

<ufeh8v$2ve2c$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6701&group=comp.unix.shell#6701

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Mon, 2 Oct 2023 15:40:47 +0200
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <ufeh8v$2ve2c$2@dont-email.me>
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com>
<ufct99$2hrnj$1@dont-email.me> <wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>
<ufe2jg$1kh2s$1@news.xmission.com> <ufe87f$2th4o$1@dont-email.me>
<651ab6df$0$7778$426a74cc@news.free.fr> <ufeg41$2v867$1@dont-email.me>
<651ac807$0$8238$426a74cc@news.free.fr>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 2 Oct 2023 13:40:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5ea5cc6f44d41f8e21bc681ec9fcea2a";
logging-data="3127372"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18avYwuy/MOHK3T9TzYjsmt"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:rQYs2uxswg7sLvl3Dzj3LDoYeMA=
In-Reply-To: <651ac807$0$8238$426a74cc@news.free.fr>
 by: Janis Papanagnou - Mon, 2 Oct 2023 13:40 UTC

On 02.10.2023 15:39, Damien Wyart wrote:
>>> I found this https://github.com/att/ast/tree/master/src/cmd/tw" rel="nofollow" target="_blank">https://github.com/att/ast/tree/master/src/cmd/tw
>
> * Janis Papanagnou <janis_papanagnou+ng@hotmail.com> in comp.unix.shell:
>> (I cannot even get or clone it from here.)
>
> Sorry, just wanted to point out "tw" in a precise way.
> The root of the repository is here: https://github.com/att/ast

Ah, thanks!

Janis

Re: why is it OK for grep to find files?

<wwv4jj8nqb1.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6704&group=comp.unix.shell#6704

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.shell
Subject: Re: why is it OK for grep to find files?
Date: Tue, 03 Oct 2023 08:00:34 +0100
Organization: terraraq NNTP server
Message-ID: <wwv4jj8nqb1.fsf@LkoBDZeT.terraraq.uk>
References: <ufblqv$1hpjc$1@dont-email.me> <20231001095145.664@kylheku.com>
<ufct99$2hrnj$1@dont-email.me> <wwvr0mda4am.fsf@LkoBDZeT.terraraq.uk>
<ufebb1$2ucbq$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="29137"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:1YhWFB1en7OsLUAn//zvyb+WNBs=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Tue, 3 Oct 2023 07:00 UTC

Ed Morton <mortonspam@gmail.com> writes:
> On 10/2/2023 2:09 AM, Richard Kettlewell wrote:
>> Ed Morton <mortonspam@gmail.com> writes:
>>> So I don't see any of that as justifying adding a bunch of options to
>>> grep to do something other than it's primary purpose of g/re/p and
>>> making it different from all other text processing tools in that
>>> regard.
>> Why do you think it needs justifying? It’s their code, they can add
>> whatever they like to it.
>
> The GNU people added functionality to grep in a way that is
> contradictory to the Unix philosophy and makes it inconsistent with
> all other text processing tools.

Why does that matter?

> So far the only suggestion I've heard for why they did that is so
> people could do:
>
> grep -r 'regexp'
>
> instead of:
>
> find . -type f -exec grep -H 'regexp' {} +
>
> which saves us about 20 simple, common characters over find+grep but
> does nothing for find+awk, find+sed, etc.

Sounds good to me. Less typing = better. Given the uptake of the GNU
tools I suspect my opinion is widely shared.

--
https://www.greenend.org.uk/rjk/

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor