Re: Useless Use Of Regexes

Liste des GroupesRevenir à col misc 
Sujet : Re: Useless Use Of Regexes
De : sc (at) *nospam* fiat-linux.fr (Stéphane CARPENTIER)
Groupes : comp.os.linux.misc
Date : 12. Apr 2025, 12:23:14
Autres entêtes
Organisation : Mulots' Killer
Message-ID : <67fa4d22$0$28083$426a74cc@news.free.fr>
References : 1 2 3 4 5 6 7
User-Agent : slrn/pre1.0.4-9 (Linux)
Le 07-04-2025, Lawrence D'Oliveiro <ldo@nz.invalid> a écrit :
On 06 Apr 2025 08:40:54 GMT, Stéphane CARPENTIER wrote:
>
Le 31-03-2025, Lawrence D'Oliveiro <ldo@nz.invalid> a écrit :
>
On 30 Mar 2025 22:04:45 GMT, Stéphane CARPENTIER wrote:
>
Yes, with the right option and/or with the right modification of the
command line. But it's easier and faster to just add a cat than to
find the "right" way to do it.
>
Give an example.
 
A lot of time I run cat to find some information in a file. And when the
file is bigger than expected, I'll just grep its output. Of course,
it's better to directly grep the file, but it's easier and faster to add
a grep at the end of the previous command than to either write directly
the right command or to go at the beginning of the line to remove the
cat and put grep instead. Mostly when the name of the file is long in a
far remote directory.
>
You do have command-line editing enabled, right? You just press the HOME
key (or CTRL/A) to go to the start of the line.

Yes. And then, I have to remove "cat". And only then can I write "grep".
Which is more difficult than just writing "| grep" at the end of the
line. So your solution is just a pedantic one to prove you can write a
theoretically better command. But it's a more difficult one and without
any advantage. Because "cat" is so fast that no human being can see the
difference in computer ressources with and without it. And it takes me
more time to think about not using cat than about adding "grep" at the
end of the line. Because it's more natural: "I have to many output, I
just reduce them" is faster and easier than to think about I have to
start at the beginning and think: "Now that I know there are to
many lines in my file, what what perfect command should I write?"

So, yes, it's a real example of a UUOC aficionado for no reason. You
prefer to avoid cat at all cost? Good for you. But telling others they
should avoid it at all cost just just because one can do better brings
you in the way of LP/DG/FF/NV/whatever.

So, you wanted an example of a good reason to use cat when it could be
avoided? I gave you one. When I want to have a result, I don't want to
be distracted to think about "the good way to do it". I want my result
as fast as possible. And I get it. Fast and easy. Your way is just
cumbersome for no advantage.

So, now, instead of telling me it's better to avoid cat at all cost,
tell me why it's better. If I can win  0.00001 second on the result,
it's useless. If I can spare 0.00001% of my processor ressources, it's
useless. So, why should I avoid cat as much as is possible? Is there a
security reason? Is there a real benefit? Or are you just like
LP/FF/NV/DG/whatever who claims things because they are written in very
old books which makes you think you know better than others?

--
Si vous avez du temps à perdre :
https://scarpet42.gitlab.io

Date Sujet#  Auteur
24 Mar 25 * Useless Use Of Regexes66Lawrence D'Oliveiro
24 Mar 25 +* Re: Useless Use Of Regexes29Pancho
24 Mar 25 i+- Re: Useless Use Of Regexes1The Natural Philosopher
24 Mar 25 i+* Re: Useless Use Of Regexes26Lawrence D'Oliveiro
25 Mar 25 ii+* Re: Useless Use Of Regexes3Marc Haber
26 Mar 25 iii`* Re: Useless Use Of Regexes2Lawrence D'Oliveiro
26 Mar 25 iii `- Re: Useless Use Of Regexes1Marc Haber
25 Mar 25 ii+* Re: Useless Use Of Regexes21Anssi Saari
25 Mar 25 iii`* Re: Useless Use Of Regexes20Marc Haber
26 Mar 25 iii +* Re: Useless Use Of Regexes16Lawrence D'Oliveiro
26 Mar 25 iii i`* Re: Useless Use Of Regexes15Marc Haber
26 Mar 25 iii i `* Re: Useless Use Of Regexes14Lawrence D'Oliveiro
26 Mar 25 iii i  +* Re: Useless Use Of Regexes12Marc Haber
27 Mar 25 iii i  i`* Re: Useless Use Of Regexes11Lawrence D'Oliveiro
27 Mar 25 iii i  i `* Re: Useless Use Of Regexes10Marc Haber
27 Mar 25 iii i  i  `* Re: Useless Use Of Regexes9Lawrence D'Oliveiro
27 Mar 25 iii i  i   `* Re: Useless Use Of Regexes8Marc Haber
27 Mar 25 iii i  i    `* Re: Useless Use Of Regexes7Lawrence D'Oliveiro
28 Mar 25 iii i  i     +* Re: Useless Use Of Regexes5marrgol
28 Mar 25 iii i  i     i+* Re: Useless Use Of Regexes3Chris Ahlstrom
28 Mar 25 iii i  i     ii`* Re: Useless Use Of Regexes2rbowman
29 Mar 25 iii i  i     ii `- Re: Useless Use Of Regexes1Chris Ahlstrom
28 Mar 25 iii i  i     i`- Re: Useless Use Of Regexes1Lawrence D'Oliveiro
1 Apr 25 iii i  i     `- Re: Useless Use Of Regexes1Wayne
27 Mar 25 iii i  `- Re: Useless Use Of Regexes1c186282
26 Mar 25 iii `* Re: Useless Use Of Regexes3c186282
26 Mar 25 iii  `* Re: Useless Use Of Regexes2rbowman
27 Mar 25 iii   `- Re: Useless Use Of Regexes1c186282
25 Mar 25 ii`- Re: Useless Use Of Regexes1Pancho
30 Mar 25 i`- Re: Useless Use Of Regexes1Stéphane CARPENTIER
25 Mar 25 +- Re: Useless Use Of Regexes1Ben Collver
30 Mar 25 `* Re: Useless Use Of Regexes35Stéphane CARPENTIER
30 Mar 25  `* Re: Useless Use Of Regexes34Lawrence D'Oliveiro
30 Mar 25   `* Re: Useless Use Of Regexes33Stéphane CARPENTIER
31 Mar 25    `* Re: Useless Use Of Regexes32Lawrence D'Oliveiro
6 Apr 25     `* Re: Useless Use Of Regexes31Stéphane CARPENTIER
7 Apr 25      `* Re: Useless Use Of Regexes30Lawrence D'Oliveiro
8 Apr 25       +- Re: Useless Use Of Regexes1c186282
8 Apr 25       +* Re: Useless Use Of Regexes21Eli the Bearded
8 Apr 25       i+- Re: Useless Use Of Regexes1c186282
8 Apr 25       i+- Re: Useless Use Of Regexes1Lawrence D'Oliveiro
8 Apr 25       i+* Re: Useless Use Of Regexes17Anssi Saari
9 Apr 25       ii`* Re: Useless Use Of Regexes16Lawrence D'Oliveiro
9 Apr 25       ii +* Re: Useless Use Of Regexes13c186282
9 Apr 25       ii i`* Shell command history (was: Useless Use Of Regexes)12Geoff Clare
12 Apr 25       ii i `* Re: Shell command history (was: Useless Use Of Regexes)11Lawrence D'Oliveiro
13 Apr 25       ii i  +- Re: Shell command history (was: Useless Use Of Regexes)1Eli the Bearded
14 Apr 25       ii i  `* Re: Shell command history9Nuno Silva
14 Apr 25       ii i   `* Re: Shell command history8Lawrence D'Oliveiro
16 Apr 25       ii i    +* Re: Shell command history6Eli the Bearded
16 Apr 25       ii i    i+- Re: Shell command history1Andreas Eder
16 Apr 25       ii i    i`* Re: Shell command history4Lawrence D'Oliveiro
18 Apr 25       ii i    i `* Re: Shell command history3Eli the Bearded
19 Apr 25       ii i    i  `* Re: Shell command history2Lawrence D'Oliveiro
20 Apr 25       ii i    i   `- Re: Shell command history1Eli the Bearded
18 Apr 25       ii i    `- Re: Shell command history1Nuno Silva
9 Apr 25       ii `* Re: Useless Use Of Regexes2Anssi Saari
12 Apr 25       ii  `- Re: Useless Use Of Regexes1Lawrence D'Oliveiro
12 Apr 25       i`- Re: Useless Use Of Regexes1Stéphane CARPENTIER
12 Apr 25       `* Re: Useless Use Of Regexes7Stéphane CARPENTIER
13 Apr 25        `* Re: Useless Use Of Regexes6Lawrence D'Oliveiro
13 Apr 25         +* Re: Useless Use Of Regexes4Stéphane CARPENTIER
14 Apr 25         i`* Re: Useless Use Of Regexes3Lawrence D'Oliveiro
17 Apr 25         i `* Re: Useless Use Of Regexes2Stéphane CARPENTIER
18 Apr 25         i  `- Re: Useless Use Of Regexes1Lawrence D'Oliveiro
13 Apr 25         `- Re: Useless Use Of Regexes1candycanearter07

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal