zsh-users
 help / color / mirror / code / Atom feed
* zargs: unexpected, non-xargs behaviour
@ 2012-05-07  8:41 Stephen Blott
  2012-05-07 14:14 ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Blott @ 2012-05-07  8:41 UTC (permalink / raw)
  To: zsh-users

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-05-07 17:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-07  8:41 zargs: unexpected, non-xargs behaviour Stephen Blott
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

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).