zsh-users
 help / color / mirror / code / Atom feed
From: Stephen Blott <smblott@gmail.com>
To: zsh-users@zsh.org
Subject: zargs: unexpected, non-xargs behaviour
Date: Mon, 7 May 2012 09:41:41 +0100	[thread overview]
Message-ID: <20120507084141.GA8366@lohen.blott-online.com> (raw)

Hi,

Consider this script:

# ----------------------------------------------------

   autoload -U zargs

   data=(foo bar)

   echo $data | xargs -n 1 echo XX
   zargs -n 1 -- $data -- =echo XX

# ----------------------------------------------------

I expected these to be equivalent, but here's the output:

   $ zsh < zargs_test.sh
   XX foo                                                                         
   XX bar                                                                         
   zargs: argument list too long                                                  
   zsh: exit 1     zsh < zargs_test.sh

To get zargs to work as intended (separate calls to echo for each
argument), I have use "-n 2".

So, at least for this example, when the documentation says "This function
works like GNU xargs, ...", that doesn't appear to be the case.

Am I missing something?

Steve



             reply	other threads:[~2012-05-07  9:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07  8:41 Stephen Blott [this message]
2012-05-07 14:14 ` Bart Schaefer
2012-05-07 14:24   ` Moritz Bunkus
2012-05-07 14:26     ` Moritz Bunkus
2012-05-07 15:25       ` Bart Schaefer
2012-05-07 16:10         ` Moritz Bunkus
2012-05-07 17:02           ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120507084141.GA8366@lohen.blott-online.com \
    --to=smblott@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).