From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24270 invoked by alias); 31 Oct 2012 22:42:33 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17367 Received: (qmail 5306 invoked from network); 31 Oct 2012 22:42:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at linux.vnet.ibm.com does not designate permitted sender hosts) Date: Thu, 1 Nov 2012 06:32:06 +0800 From: Han Pingtian To: zsh-users@zsh.org Subject: Re: question about zargs Message-ID: <20121031223206.GA19590@localhost.localdomain> References: <20121031134007.GA9731@localhost.localdomain> <20121031142546.529e1709@pwslap01u.europe.root.pri> <121031093018.ZM11752@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <121031093018.ZM11752@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12103122-1976-0000-0000-000012E92C82 On Wed, Oct 31, 2012 at 02:25:46PM +0000, Peter Stephenson wrote: > On Wed, 31 Oct 2012 21:40:07 +0800 > Han Pingtian wrote: > > I just learnt that there is a function 'zargs' which just like > > 'xargs'. So why we need the 'zargs' as we have 'xargs' already? > > > > As a example, this works just fine with 'xargs': > > > > % print -N **/* | xargs -n1 -0 ls > > It works, but with more processes. zargs allows you to have things > (though not ls) running completely in the shell. In that case, you > aren't sensitive to the size of the argument list passed to an > external > process. > On Wed, Oct 31, 2012 at 09:30:17AM -0700, Bart Schaefer wrote: > Preface for Han Pingtian: If the command you're going to run is external > to the shell, then I recommend you use xargs. However, in some cases it > may be desirable to get xargs-like behavior when passing arguments to a > shell function or builtin, which is why there is zargs. > Thanks so much, Peter and Bart.