zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: zargs: unexpected, non-xargs behaviour
Date: Mon, 07 May 2012 08:25:22 -0700	[thread overview]
Message-ID: <120507082522.ZM10556@torch.brasslantern.com> (raw)
In-Reply-To: <CANPayMQKMvGCL=RpMOiO=7MC=x-YugD+BQ8DEGQ2Z4vv4HMjVw@mail.gmail.com>
In-Reply-To: <CANPayMQ9WOWZNMzXqzVTbUSQ2z1PvirGF6Aq619i5bMtb87Bsw@mail.gmail.com>

[Combining a couple of replies here.]

On May 7,  4:14 and 4:24pm, Moritz Bunkus wrote:
}
} Well, then zargs is not POSIX compliant
} ...and also not equivalent to GNU xargs.

Well, if you'll pardon the expression, duh.  The whole premise of zargs
is off the xargs rails because it doesn't read files or count lines.

} Also: In GNU xargs "-L" and "-n" have the very, very important
} distinction that "-L" implies "-x" while "-n" does not (GNU xargs from
} findutils 4.4.2).

The more important distinction is that in xargs -L and -n are counting
completely different things.  In zargs they're both counting the same
thing.  In fact neither -L nor -n implies -x in zargs (the exit in your
example has nothing to do with the -s option, and -x only applies when
the -s size is exceeded).

} if I read
} http://pubs.opengroup.org/onlinepubs/000095399/utilities/xargs.html
} right as the POSIX documentation does not mention aborting if there
} are more than "-n arg" arguments in total. On the contrary, it talks
} about using fewer than "arg" if there are less _during the last
} iteration_.

True, but again only sensible if "number of lines" and "number of args"
mean different things.  Because of the way zargs divides up the array
of arguments, there's no case in which it will ever do any useful work
if the contraints on -n are violated; would you have been less confused
if it did nothing and exited with success?


  reply	other threads:[~2012-05-07 15:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07  8:41 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 [this message]
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=120507082522.ZM10556@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).