From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18397 invoked from network); 18 Aug 2006 23:44:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Aug 2006 23:44:16 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 79284 invoked from network); 18 Aug 2006 23:44:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Aug 2006 23:44:07 -0000 Received: (qmail 21765 invoked by alias); 18 Aug 2006 23:44:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22625 Received: (qmail 21755 invoked from network); 18 Aug 2006 23:44:04 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Aug 2006 23:44:04 -0000 Received: (qmail 78986 invoked from network); 18 Aug 2006 23:44:04 -0000 Received: from ug-out-1314.google.com (66.249.92.168) by a.mx.sunsite.dk with SMTP; 18 Aug 2006 23:44:03 -0000 Received: by ug-out-1314.google.com with SMTP id c2so2076496ugf for ; Fri, 18 Aug 2006 16:44:02 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=M1AaD8D/KcVZx6UZRFj5sbEA/LWNUmnPVV2yL4I/qnGiZ+TOhhdXgUnED3l+CyfXDGemeWVAbM7VB+RShWZMWCHOonyddY3lydc/w834AyU388S/vr/FF/739nghCsOUnK/0Z0BAuuK5xQBwAuAjDt4iRiojsEslI6HeQuz6zLc= Received: by 10.67.24.13 with SMTP id b13mr2096010ugj; Fri, 18 Aug 2006 16:44:02 -0700 (PDT) Received: by 10.66.222.13 with HTTP; Fri, 18 Aug 2006 16:44:02 -0700 (PDT) Message-ID: <237967ef0608181644i178aa2f7m910bf892075be891@mail.gmail.com> Date: Sat, 19 Aug 2006 01:44:02 +0200 From: "Mikael Magnusson" To: zsh-workers Subject: Re: zargs doesn't work reliably In-Reply-To: <060818111547.ZM24340@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <237967ef0608171559k1bd8053bxf7a3d1cb53ef33e7@mail.gmail.com> <060817194225.ZM23196@torch.brasslantern.com> <237967ef0608172016s4a47b309sd4a78f5889cfe2c7@mail.gmail.com> <20060818112439.GC27421@ay.vinc17.org> <237967ef0608180612n3c57c588t6c75e7bf90c6eb5@mail.gmail.com> <060818111547.ZM24340@torch.brasslantern.com> On 8/18/06, Bart Schaefer wrote: > On Aug 17, 8:17pm, Mikael Magnusson wrote: > } > } > There are approximately eleventeen zillion unix/linux commands that > } > break given those file names, including rm, ls, and cp, so I'm not > } > going to get particularly worked up about zargs behaving similarly. > } > } % ls -l -- * > > Yes, and you used an explicit "--" to tell ls that there might be "--" > in its argument list; it would have failed if you did not. The same > goes for "zargs -e". > > } Would this be possible? > } zargs '[options]' 'command [initial-args]' [input-args] > > I'm not going to agree with you about any scheme that breaks congruence > with the way xargs accepts its command and initial-args. The whole point > of zargs is to mimic xargs as closely as possible. > > } Sorry, I should have looked in the manual. In my defense zargs --help > } was so helpful that i didn't suspect it left anything useful out and i > } did say i was tired :). Thanks for the pointers. > > Thanks for the compliment about the help. It does say fairly early: > > Options: > --eof[=eof-str], -e[eof-str] > Change the end-of-input-args string from "--" to eof-str. If > given as --eof=, an empty argument is the end; as --eof or -e, > with no (or an empty) eof-str, all arguments are input-args. After reading this a couple of times and trying some different commands i came up with this working command: % zargs --eof= -- * '' ls -d -- -- -+ > On Aug 18, 6:12am, Mikael Magnusson wrote: > } > } > What if you need an initial-arg that contains a space? > } > } I don't quite understand the question... zargs '' 'touch file\ with\ > } spaces' /tmp/* > } or zargs '' 'touch "file with spaces"' /tmp/* > > What if you have one initial-arg with a space, one with a backslash, one > with a single quote, and one with a double-quote? > > The input-args already come to you "quoted" via the globbing mechansim. > It's much easier to pick something (including empty string, see the help > snippet above) that won't appear in the input-args than it is to quote > your way around oddities in the initial-args. I didn't mean to sound like the current way is wrong and i have all the answers, although it might have sounded a bit like that; i just meant to make suggestions or ask if things would work that way. Thanks again for your helpful help, and in the meantime i have another question :). (->new thread) -- Mikael Magnusson