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

Re: zargs: Argument list too long



On 1 Mar 2019, at 12:56, gi1242+zsh@xxxxxxxxx wrote:
>But if I do
>
>   zargs -n 1 -- arg1 arg2 arg3 -- echo Argument:
>
>I get an unfriendly error message

The comments at the top of the zargs function source explain this and some
other useful things. On recent versions of zsh you can read it with:

  autoload +X zargs; cat $functions_source[zargs]

It has this to say about -n:

>POSIX -L and -n are mutually exclusive and effectively synonymous;
>zargs accepts both and considers -n to be a limit on the total number
>of arguments per command line, that is, including the initial-args.
>Thus the following fails with "argument list too long":
>  zargs -n 3 -- echo Here are four words
>The smallest limit implied by the combination of -L and -n is used.

So... just use -L (or -l) instead of -n

dana



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