Sujet : Re: Useless Use Of Regexes
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.miscDate : 26. Mar 2025, 01:35:10
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vrvi3t$gce5$2@dont-email.me>
References : 1 2 3 4
User-Agent : Pan/0.162 (Pokrosvk)
On Tue, 25 Mar 2025 08:30:56 +0100, Marc Haber wrote:
I'd prefer a regexp over jq any time. But that's probably wrong.
I’ll use whatever’s available. The first thing to do is look for
options to customize the output, to reduce or even eliminate the need
to pull bits out with regexes or other complex parsing.
Example of how not to do things:
<
https://arstechnica.com/gadgets/2021/09/command-line-wizardry-part-two-variables-and-loops-in-bash/>
N.B.: ip addr --oneline
root@theon:~ # ip addr --oneline
Command "--oneline" is unknown, try "ip address help".
root@theon:~ # ip addr show --oneline
Device "--oneline" does not exist.
root@theon:~ # ip --oneline addr show
[got it]