Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zargs: unexpected, non-xargs behaviour



[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?



Messages sorted by: Reverse Date, Date, Thread, Author