Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
zargs: unexpected, non-xargs behaviour
- X-seq: zsh-users 17057
- From: Stephen Blott <smblott@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: zargs: unexpected, non-xargs behaviour
- Date: Mon, 7 May 2012 09:41:41 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=0W30kJqI2xh3qM2MiLqR5GYLh3NFrP5EuuNNeIj9u+g=; b=OLDUWJXoCZkW5uTotM7EMbd35q36LKAmGOEYVy/Sbi84a/qL32xSzZZHdFOBkmamSN HyLyy+qVO16qks4B1pZIWJbO4gb92u021YeFVBzq20XWOptaBz7x0BWOgfMt1omBlv4i 2MaM7uyT7uH0Powe/MZAXea3kMHqsq7ZhrOmZ6klGHNQLIPB35s7EYKYK/UC8luYs4kE VJEgHcuCVfZIIjPP9T6n8PyaFHokkhSQr+YumiJB5/vIUMivxuskS0TaC/vBlh32wmsm E2VsdIUqJF/KTR4g4VFgcwxtXKstNXZyb3qKAKLd7XwjJBiaZq9HXGmpIwtD2XXwZtEZ f5eg==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author