From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] help, i'm in a wet paper bag and I can't get out From: rog@vitanuova.com MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20010612094321.76E9A19A06@mail.cse.psu.edu> Date: Tue, 12 Jun 2001 10:51:50 +0100 Topicbox-Message-UUID: b5acc880-eac9-11e9-9e20-41e7f4b1d025 sergent@IO.COM wrote: > { > while () { > line=`{read} > echo line: $line > } > } < filename only problem is that's not very efficient, and possibly wrong (for packet oriented connections, such as UDP), as it can only read one character at a time... that buffering problem was the reason i implemented a getlines primitive in the inferno std module which defines its own loop: getlines { echo line: $line } < filename still, i'm not sure that shell scripts are the right place to be implementing network protocols (although i can't say i'm entirely innocent). dhog made a good suggestion: that way you can run your program on any system supported by inferno, which is a nice bonus. cheers, rog.