Deutsch   English   Français   Italiano  
<v7dt2r$3147j$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Jeremy Brubaker <jbrubake.362@orionarts.invalid>
Newsgroups: comp.lang.awk
Subject: Re: A feature I'd like to see in GAWK...
Date: Fri, 19 Jul 2024 14:26:35 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <v7dt2r$3147j$1@dont-email.me>
References: <v73pof$3gdp5$2@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 19 Jul 2024 16:26:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="2f0d9fe02906334be92540cbd535fd75";
	logging-data="3182835"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+N466el+oGwLcR5hrlG6okShW2wQgXuPU="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:2gEq4bvUpXotvbQHYtKEERPKkTU=
Bytes: 2440

On 2024-07-15, Kenny McCormack wrote:
> As we know, AWK in general, and GAWK in particular, has several different
> ways of getting data into the program.  In addition to the Automatic Input
> Loop (the main feature of AWK), there are several variations of "getline".
>
> "getline" can be used with files, or with processes (in 2 different ways!),
> or even with network sockets.  But the problem with getline is that using
> it breaks the Automatic Input Loop.  You can't use the standard
> "pattern/action" paradigm if your input is coming in via "getline".  Yes,
> there are workarounds and yes we've all gotten used to it, but it is a
> shame.  For one thing, you can write your program as a shell script, and
> use the shell to pipe in the data from a process.  But this is ugly.  And
> not always sufficient.
>
> Now, I have written a GAWK extension to handle this - called
> "pipeline".

That sounds quite useful. I am fairly certain I have wished a feature
like that existed and ended up just wrapping awk with sh but I agree
that's ugly.

Awk is underrated IMHO. Not that json/yaml/etc aren't useful things but
frequently when I seem them used my first thought is "If you had just
done well-formatted text records I could have parsed this with awk".

-- () www.asciiribbon.org  | Jeremy Brubaker /\  - against html mail |
јЬruЬаkе@оrіоnаrtѕ.іо / neonrex on IRC

Even a hawk is an eagle among crows.