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 Regexes57Lawrence 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 Regexes26Stéphane CARPENTIER
30 Mar 25  `* Re: Useless Use Of Regexes25Lawrence D'Oliveiro
30 Mar 25   `* Re: Useless Use Of Regexes24Stéphane CARPENTIER
31 Mar 25    `* Re: Useless Use Of Regexes23Lawrence D'Oliveiro
6 Apr 25     `* Re: Useless Use Of Regexes22Stéphane CARPENTIER
7 Apr 25      `* Re: Useless Use Of Regexes21Lawrence D'Oliveiro
8 Apr 25       +- Re: Useless Use Of Regexes1c186282
8 Apr 25       +* Re: Useless Use Of Regexes14Eli 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 Regexes10Anssi Saari
9 Apr 25       ii`* Re: Useless Use Of Regexes9Lawrence D'Oliveiro
9 Apr 25       ii +* Re: Useless Use Of Regexes6c186282
9 Apr 25       ii i`* Shell command history (was: Useless Use Of Regexes)5Geoff Clare
12 Apr07:55       ii i `* Re: Shell command history (was: Useless Use Of Regexes)4Lawrence D'Oliveiro
13 Apr00:55       ii i  +- Re: Shell command history (was: Useless Use Of Regexes)1Eli the Bearded
14 Apr09:47       ii i  `* Re: Shell command history2Nuno Silva
14 Apr23:37       ii i   `- Re: Shell command history1Lawrence D'Oliveiro
9 Apr 25       ii `* Re: Useless Use Of Regexes2Anssi Saari
12 Apr07:55       ii  `- Re: Useless Use Of Regexes1Lawrence D'Oliveiro
12 Apr14:07       i`- Re: Useless Use Of Regexes1Stéphane CARPENTIER
12 Apr12:23       `* Re: Useless Use Of Regexes5Stéphane CARPENTIER
13 Apr05:54        `* Re: Useless Use Of Regexes4Lawrence D'Oliveiro
13 Apr19:25         +* Re: Useless Use Of Regexes2Stéphane CARPENTIER
14 Apr23:39         i`- Re: Useless Use Of Regexes1Lawrence D'Oliveiro
13 Apr20:00         `- Re: Useless Use Of Regexes1candycanearter07

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal