Groups | Search | Server Info | Login | Register


Groups > comp.lang.awk > #177

Re: getline timeout (revisited)

From arnold@skeeve.com (Aharon Robbins)
Newsgroups comp.lang.awk
Subject Re: getline timeout (revisited)
Date 2011-04-22 13:55 +0000
Organization TornevallNET - http://news.tornevall.net
Message-ID <ios1cp$bn6$1@tornado.tornevall.net> (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>

Show all headers | View raw


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.

My two cents, of course.
-- 
Aharon (Arnold) Robbins 			arnold AT skeeve DOT com
P.O. Box 354		Home Phone: +972  8 979-0381
Nof Ayalon		Cell Phone: +972 50  729-7545
D.N. Shimshon 99785	ISRAEL

Back to comp.lang.awk | Previous | NextPrevious in thread | Next 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