From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <531b9b8ab78014b01db61629fece8281@plan9.escet.urjc.es> To: 9fans@cse.psu.edu Subject: Re: [9fans] rc - how to... From: Fco.J.Ballesteros MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-youonngozjkdotqebefbgrnkug" Date: Fri, 13 Sep 2002 10:01:50 +0200 Topicbox-Message-UUID: e974e66a-eaca-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-youonngozjkdotqebefbgrnkug Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Most of the times I wanted to do "while read { x }" I could rewrite it to be "sed 's/^/x /' | rc", which works like a charm. --upas-youonngozjkdotqebefbgrnkug Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by aquamar; Thu Sep 12 16:35:21 MDT 2002 Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.8.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id DF5011999B; Thu, 12 Sep 2002 10:35:09 -0400 (EDT) Delivered-To: 9fans@cse.psu.edu Received: from doppio.vitanuova.com (unknown [62.254.170.97]) by mail.cse.psu.edu (CSE Mail Server) with SMTP id 1D431199EC for <9fans@cse.psu.edu>; Thu, 12 Sep 2002 10:34:34 -0400 (EDT) Message-ID: <35d1a51a345858e759eea904502ce78e@vitanuova.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] rc - how to... From: rog@vitanuova.com MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Thu, 12 Sep 2002 15:42:38 +0100 > du / | while(file=`{read}) > echo $file it's probably worth mentioning that this is really quite slow, as the read command is unable to do any IO buffering, must read one character at a time, and is reloaded on every line of input: on my machine, while (file=`{read}) {} exececutes about 85 lines a second, whereas a simple xargs-like program processes about 4300. this could be quite significant if you're using to process output from du (what was viable in the old bourne shell with du . | while read x do something with $x done is not necessarily fast enough in the rc equivalent) --upas-youonngozjkdotqebefbgrnkug--