Groups | Search | Server Info | Login | Register


Groups > comp.lang.awk > #178

Re: getline timeout (revisited)

From Grant <omg@grrr.id.au>
Newsgroups comp.lang.awk
Subject Re: getline timeout (revisited)
Date 2011-04-23 06:50 +1000
Organization scattered bugs
Message-ID <pdq3r6pj0tp5e7in6d9om87brout7jgp9h@4ax.com> (permalink)
References <inmun6$lq1$1@speranza.aioe.org> <xpKdne1Tg-IuVTPQnZ2dnUVZ_hCdnZ2d@mchsi.com> <iomj2j$j9o$1@speranza.aioe.org> <s-idnXrjvPkiQDPQnZ2dnUVZ_u-dnZ2d@mchsi.com> <ios1cp$bn6$1@tornado.tornevall.net>

Show all headers | View raw


On Fri, 22 Apr 2011 13:55:40 +0000 (UTC), arnold@skeeve.com (Aharon Robbins) wrote:

>In article <s-idnXrjvPkiQDPQnZ2dnUVZ_u-dnZ2d@mchsi.com>,
> <j.eh@mchsi.com> wrote:
>>On a related note, someone had a wish for the ability to specify
>>a two-way process name as a file name in the gawk command line in
>>a thread titled "Dreamer's Wishlist". I don't know what exactly
>>he had in mind, but I am assuming the intention was to avoid getline
>>altogether to read from the socket like this:
>>
>>/pat/ { print $0 }
>>
>>'pat' is matched against data read from the socket.
>
>Do this with bash, which lets you open two way connections to a
>socket. Something like:
>
>	awk -f myprog 0<> /dev/tcp/host/whatever/the/syntax/is/in/bash 1<>&0
>
>I think that's right... :-)  (The <> opens for read/write.)
>
>This whole discussion is interesting, but I think the wrong approach.
>I think it would be done better as a dynamically loadable builtin function
>than in trying to stretch the language any further.

A couple years ago my impression was gawk didn't do sockets very well, plus 
no signal handling, so I wrote a server in perl for that.  You can't get a 
sweet little language like awk to do everything :)  I agree with you.

Grant.
>
>My two cents, of course.

Back to comp.lang.awk | Previous | NextPrevious in thread | Find similar


Thread

getline timeout (revisited) Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-04-08 14:23 +0200
  Re: getline timeout (revisited) arnold@skeeve.com (Aharon Robbins) - 2011-04-10 18:49 +0000
  Re: getline timeout (revisited) j.eh@mchsi.com - 2011-04-19 09:09 -0500
    Re: getline timeout (revisited) Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-04-19 17:38 +0200
      Re: getline timeout (revisited) j.eh@mchsi.com - 2011-04-20 06:51 -0500
        Re: getline timeout (revisited) Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-04-20 14:20 +0200
          Re: getline timeout (revisited) j.eh@mchsi.com - 2011-04-20 08:21 -0500
            Re: getline timeout (revisited) j.eh@mchsi.com - 2011-04-21 05:46 -0500
            Re: getline timeout (revisited) arnold@skeeve.com (Aharon Robbins) - 2011-04-22 13:55 +0000
              Re: getline timeout (revisited) Grant <omg@grrr.id.au> - 2011-04-23 06:50 +1000

csiph-web