From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 298 invoked from network); 18 Aug 2006 02:42:57 -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.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,UNPARSEABLE_RELAY 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 02:42:57 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 63309 invoked from network); 18 Aug 2006 02:42:50 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Aug 2006 02:42:50 -0000 Received: (qmail 13933 invoked by alias); 18 Aug 2006 02:42:47 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22616 Received: (qmail 13920 invoked from network); 18 Aug 2006 02:42:47 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Aug 2006 02:42:47 -0000 Received: (qmail 62856 invoked from network); 18 Aug 2006 02:42:47 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 18 Aug 2006 02:42:46 -0000 Received: from torch.brasslantern.com ([71.121.0.226]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J4600H58A6Q70V8@vms044.mailsrvcs.net> for zsh-workers@sunsite.dk; Thu, 17 Aug 2006 21:42:27 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k7I2gQQC023198 for ; Thu, 17 Aug 2006 19:42:26 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k7I2gPBT023197 for zsh-workers@sunsite.dk; Thu, 17 Aug 2006 19:42:25 -0700 Date: Thu, 17 Aug 2006 19:42:25 -0700 From: Bart Schaefer Subject: Re: zargs doesn't work reliably In-reply-to: <237967ef0608171559k1bd8053bxf7a3d1cb53ef33e7@mail.gmail.com> To: zsh-workers Message-id: <060817194225.ZM23196@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <237967ef0608171559k1bd8053bxf7a3d1cb53ef33e7@mail.gmail.com> Comments: In reply to "Mikael Magnusson" "zargs doesn't work reliably" (Aug 17, 3:59pm) On Aug 17, 3:59pm, Mikael Magnusson wrote: } } Usage: zargs [options --] [input-args] [-- command [initial-args]] } } % touch -- -- -+ 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. However, if you'd looked just a little further, you'd find that in fact zargs already has a solution for this problem. There is even an example in the manual: In the event that the string `--' is or may be an INPUT, the -e option may be used to change the end-of-inputs marker. Note that this does _not_ change the end-of-options marker. For example, to use `..' as the marker: zargs -e.. -- **/*(.) .. ls -l This is a good choice in that example because no plain file can be named `..', but the best end-marker depends on the circumstances. (End manual page example, begin new one.) You can even do: zargs -e$'\0' -- * $'\0' ls -d unless you somehow have a file named (the nul byte). } since input-args is the only part you do not control The only part who does not control? } it should come last, like so } Usage: zargs [options --] [command [initial-args]] -- [input-args] I think the designers of the xargs command, after which zargs is closely modeled, would disagree with you. See "man xargs". } A problem is how to give -- as initial-args then Precisely. Another problem is that the command and initial-args may be omitted, but the input-args may not be.