Sujet : Re: a sed question
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.unix.shellDate : 22. Dec 2024, 21:03:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241222114645.813@kylheku.com>
References : 1 2 3
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-12-21, Lawrence D'Oliveiro <
ldo@nz.invalid> wrote:
On Sat, 21 Dec 2024 08:13:52 -0600, Ed Morton wrote:
>
for anything else you should just use awk ...
>
If you want to suggest Awk, you might as well use Perl. That does
everything Awk does, just as concisely, and plenty more besides.
Perl certainly does not do everything that Awk does just as concisely.
The sigils on variable names alone make Perl one-liner solutions longer.
So do the extra command line options needed in order to get an Awk-like
implicit input processing loop.
For instance, deduplicate lines:
awk '!s[$0]++'
Larry Wall himself famously said something like "I still say awk
'{ print $1 }' a lot".
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca