From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200106120130.SAA20398@engmail2.Eng.Sun.COM> Content-Type: text/plain; format=flowed; charset=us-ascii From: Jonathan Sergent To: 9fans@cse.psu.edu Mime-Version: 1.0 (Apple Message framework v388) In-Reply-To: <0dcc01c0f2db$14720430$e8b7c6d4@SOMA> Subject: Re: [9fans] help, i'm in a wet paper bag and I can't get out Content-Transfer-Encoding: 7bit Date: Mon, 11 Jun 2001 18:30:09 -0700 Topicbox-Message-UUID: b5968138-eac9-11e9-9e20-41e7f4b1d025 On Monday, June 11, 2001, at 06:00 PM, Boyd Roberts wrote: > write some C program that that reads _unbuffered_ characters > and spits them until it sees 'end of line' (whatever that may be). > you should buffer the output, but _not_ the input. You could just read the manual and use /bin/read, instead of rewriting it. So you get { while () { line=`{read} echo line: $line } } < filename Somehow putting the < filename after the inner } makes rc reopen it for each loop iteration. (Am I misinterpreting this?) A more convoluted way to do to the same thing would be { echo 0 > /srv/something.$pid } < filename while () { line=`{read /srv/something.$pid} echo line: $line } rm /srv/something.$pid but that's probably better for showing off /srv to your friends than it is for actually solving the problem.