From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 22 Jan 2010 13:19:31 -0500 From: Joseph Xu To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20100122181931.GA5971@wyrm.eecs.umich.edu> References: <6a3ae47e1001220944v34a952ebv23388e2aaab247a1@mail.gmail.com> <4B59E982.1080009@comfortstore.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B59E982.1080009@comfortstore.net> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [9fans] find command reloaded Topicbox-Message-UUID: c340db06-ead5-11e9-9d60-3106f5b1d025 On Fri, Jan 22, 2010 at 01:08:02PM -0500, Corey Thomasson wrote: > On 1/22/2010 12:59 PM, Rudolf Sykora wrote: > >Regardless of me having or not having encountered a problem, > >building the whole list in advance is not really smart and will > >lead to problems at some point for sure. > > > >Thanks > >R > > > Assuming that's true, couldn't you do some kind of trick to break it > up (mind you my syntax may be wrong, I don't use plan9 often) > > for(i in a b c [and so on]) grep foo `{du -a . | awk '{print $2}' | > grep ^$i} > > If you're worried about the argument list being too long that would > break it up into 26 separate greps with smaller arg lists I believe > In linux there is the xargs command, which will read lines from stdin and distribute them in chunks to the arguments of another command, as in du -a . | awk '{print $2}' | xargs -n 10 grep foo This will take every 10 lines of stdin and append them to "grep foo". It's quite a useful command and seems to provide a unique function. Is there some equivalent of this in Plan 9? Also, the title of this thread is a bit misleading. As far as I know, find doesn't have the option to test for the contents of files, so even with find you'd have to use xargs and grep.