Subject: Re: sh reads byte by byte
To: NetBSD User-Level Technical Discussion List <tech-userlevel@NetBSD.org>
From: Greg A. Woods <woods@weird.com>
List: tech-userlevel
Date: 02/23/2007 14:53:09
At Fri, 23 Feb 2007 14:36:29 +0100,
Manuel Bouyer wrote:
> 
> Maybe this could be rewritten in awk; I'm not familiar with awk enough to
> do it, or even decide if it's a good idea. If I had to rewrite it I would
> do it in perl :)

Awk is your friend.  Perl is your enemy!  :-)  (especially for native
NetBSD programming!)

Awk is of course ideally suited for processing multi-field text records,
i.e. efficiently doing exactly the same kind of thing the sh read loop
causing all the syscalls was trying to do; and awk certainly has enough
additional features to do the invocation of external programs and to
slurp up and process their output too ("cmd | getline").

-- 
						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>       Secrets of the Weird <woods@weird.com>