Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #66623

Re: Useless Use Of Regexes

From Lawrence D'Oliveiro <ldo@nz.invalid>
Newsgroups comp.os.linux.misc
Subject Re: Useless Use Of Regexes
Date 2025-03-26 00:42 +0000
Organization A noiseless patient Spider
Message-ID <vrvigv$gce5$3@dont-email.me> (permalink)
References <vrsfkv$1md7d$1@dont-email.me> <vrsjva$1oouq$1@dont-email.me> <vrso4m$1toah$3@dont-email.me> <sm0o6xpqxwf.fsf@lakka.kapsi.fi> <vru632$lb7$1@news1.tnib.de>

Show all headers | View raw


On Tue, 25 Mar 2025 13:03:45 +0100, Marc Haber wrote:

> This is a classic example why shellscripts are inferior. If you had
> written that in python, you could just ingest iproute's output in a
> python data structire and access it naturally.
>
> A very wise German person, today a friend of mine, used to say 25
> years ago: "Verwende perl. Shell will man können, dann aber nicht
> verwenden." In English that would be "Use Perl. You want to be able
> to use Shell, but then don't use it." Today, of course, that would
> be python.

There is a certain challenge in seeing how far you can push things in
a shell script (or specifically, a bash script), before giving up and
switching to Python. For example, figuring out how to deal with
arbitrary file names, which might include funny characters like spaces
and newlines -- can that be done in bash? Yes it can. But maybe it’s
more trouble than it’s worth ...

My classic example of a large, yet well-written shell script is the
configure script for FFmpeg
<https://git.videolan.org/?p=ffmpeg.git;a=tree;h=refs/heads/master;hb=refs/heads/master>.
It’s over 8000 lines. Obviously it must be handwritten, not generated
by GNU Autotools in the traditional way, because you can actually read
it and understand what it does.

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-24 20:34 +0000
  Re: Useless Use Of Regexes Pancho <Pancho.Jones@protonmail.com> - 2025-03-24 21:48 +0000
    Re: Useless Use Of Regexes The Natural Philosopher <tnp@invalid.invalid> - 2025-03-24 22:57 +0000
    Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-24 22:59 +0000
      Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-25 08:30 +0100
        Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-26 00:35 +0000
          Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-26 08:20 +0100
      Re: Useless Use Of Regexes Anssi Saari <anssi.saari@usenet.mail.kapsi.fi> - 2025-03-25 11:09 +0200
        Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-25 13:03 +0100
          Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-26 00:42 +0000
            Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-26 08:21 +0100
              Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-26 19:45 +0000
                Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-26 21:43 +0100
                Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-26 23:50 +0000
                Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-27 07:58 +0100
                Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-27 07:25 +0000
                Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-27 16:51 +0100
                Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-27 21:05 +0000
                Re: Useless Use Of Regexes marrgol <marrgol@address.invalid> - 2025-03-28 12:21 +0100
                Re: Useless Use Of Regexes Chris Ahlstrom <OFeem1987@teleworm.us> - 2025-03-28 11:42 -0400
                Re: Useless Use Of Regexes rbowman <bowman@montana.com> - 2025-03-28 18:46 +0000
                Re: Useless Use Of Regexes Chris Ahlstrom <OFeem1987@teleworm.us> - 2025-03-29 11:40 -0400
                Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-28 20:25 +0000
                Re: Useless Use Of Regexes Wayne <wayne@nospam.invalid> - 2025-03-31 23:54 -0400
                Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-03-27 04:08 -0400
          Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-03-26 00:47 -0400
            Re: Useless Use Of Regexes rbowman <bowman@montana.com> - 2025-03-26 16:51 +0000
              Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-03-27 03:13 -0400
      Re: Useless Use Of Regexes Pancho <Pancho.Jones@protonmail.com> - 2025-03-25 12:08 +0000
    Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-03-30 14:04 +0000
  Re: Useless Use Of Regexes Ben Collver <bencollver@tilde.pink> - 2025-03-25 15:29 +0000
  Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-03-30 14:02 +0000
    Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-30 21:15 +0000
      Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-03-30 22:04 +0000
        Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-31 01:26 +0000
          Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-04-06 08:40 +0000
            Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-07 21:39 +0000
              Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-04-07 21:00 -0400
              Re: Useless Use Of Regexes Eli the Bearded <*@eli.users.panix.com> - 2025-04-08 02:05 +0000
                Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-04-07 22:06 -0400
                Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-08 05:49 +0000
                Re: Useless Use Of Regexes Anssi Saari <anssi.saari@usenet.mail.kapsi.fi> - 2025-04-08 15:39 +0300
                Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-09 01:16 +0000
                Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-04-08 22:32 -0400
                Shell command history (was: Useless Use Of Regexes) Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2025-04-09 13:26 +0100
                Re: Shell command history (was: Useless Use Of Regexes) Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-12 06:55 +0000
                Re: Shell command history (was: Useless Use Of Regexes) Eli the Bearded <*@eli.users.panix.com> - 2025-04-12 23:55 +0000
                Re: Shell command history Nuno Silva <nunojsilva@invalid.invalid> - 2025-04-14 09:47 +0100
                Re: Shell command history Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-14 22:37 +0000
                Re: Shell command history Eli the Bearded <*@eli.users.panix.com> - 2025-04-15 23:28 +0000
                Re: Useless Use Of Regexes Anssi Saari <anssi.saari@usenet.mail.kapsi.fi> - 2025-04-09 10:53 +0300
                Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-12 06:55 +0000
                Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-04-12 13:07 +0000
              Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-04-12 11:23 +0000
                Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-13 04:54 +0000
                Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-04-13 18:25 +0000
                Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-14 22:39 +0000
                Re: Useless Use Of Regexes candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-04-13 19:00 +0000

csiph-web