[BusyBox] Re: network enabled awk

castorpilot castorpilot at gmail.com
Wed Aug 24 11:52:02 MDT 2005


On 8/24/05, Rainer Weikusat <rainer.weikusat at sncag.com> wrote:
> "Peter V. Saveliev" <peet at peet.spb.ru> writes:
> > On Monday 22 August 2005 19:53, Rob Landley wrote:
> > <skip />
> >>
> >> 2) What on _earth_ would this kind of thing be used for?
> >
> > awk is a text processor. So, network extension can be used for
> > test processing over network.
> >
> > nc | awk is _not_ enough in some cases.
> 
> Certainly not. But what should be enough for all cases is something
> like
> 
>         socket -p 'awk -f ...' <host> <port>
> 
> 'The text processor' does not need to be able to open sockets, as long
> as 'a socket opening program' can do that and pass the socket to 'the
> text processor' (one of the things I happen to use around here is 'the
> socket listener' that passes forcibly redirected connections to 'the
> connector', which connects to the original destination and then calls
> 'the protocol processor' [in this case, for end-user transparent mail
> scanning of POP3 sessions]. And there are, given that this arrangement
> is running on something which would have been a pretty fast
> workstation not more than seven years ago, of course, none of the
> "mythical problems" that people constantly try to find with the
> UNIX(*) model of solving complex problems --- fork doesn't hurt me,
> exec doesn't hurt me, preemptive multiprogramming doesn't hurt me
> etc).

Using such a socket openin program would work most of the time. I
don't see, however, how awk would be able to get the file descriptors
(without changing its code), except if you redirect stdout,stderr or
stdin. But then, sometimes, you might need to use both a socket and
stdout, for example. In both cases, the code has to be (slightly)
modified, I chose to allow awk to open sockets, even if I admit it is
not the UNIX way to do things.
Not that I have anything against UNIX, believe me :)

Rob, tcc looks fine. I am afraid. I might as network enable brainfuck ;)
 

> It is not necessary to have a single program running on a computer
> which has all the required functionality, including kernel, C-library,
> mail reader and flight simulator linked in. Really.
> 
>


More information about the busybox mailing list