zsh-workers
 help / Atom feed
* zargs: Argument list too long
@ 2019-03-01 18:56 gi1242+zsh
  2019-03-01 21:04 ` dana
  0 siblings, 1 reply; 3+ messages in thread
From: gi1242+zsh @ 2019-03-01 18:56 UTC (permalink / raw)
  To: Zsh hackers list

Hi All,

When I do

    zargs -n 1 -- arg1 arg2 arg3 -- echo

it works fine. But if I do 

    zargs -n 1 -- arg1 arg2 arg3 -- echo Argument:

I get an unfriendly error message

    zargs: argument list too long

I thought I should have gotten:

    Argument: arg1
    Argument: arg2
    Argument: arg3

instead. Did I miss something?

Thanks,

GI

-- 
'Economist' -- An expert who will know tomorrow why that which he
predicted yesterday didn't happen today.

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

* Re: zargs: Argument list too long
  2019-03-01 18:56 zargs: Argument list too long gi1242+zsh
@ 2019-03-01 21:04 ` dana
  2019-03-02  2:30   ` gi1242+zsh
  0 siblings, 1 reply; 3+ messages in thread
From: dana @ 2019-03-01 21:04 UTC (permalink / raw)
  To: gi1242+zsh; +Cc: Zsh hackers list

On 1 Mar 2019, at 12:56, gi1242+zsh@gmail.com 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


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

* Re: zargs: Argument list too long
  2019-03-01 21:04 ` dana
@ 2019-03-02  2:30   ` gi1242+zsh
  0 siblings, 0 replies; 3+ messages in thread
From: gi1242+zsh @ 2019-03-02  2:30 UTC (permalink / raw)
  To: Zsh hackers list

On Fri, Mar 01, 2019 at 03:04:51PM -0600, dana wrote:

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

Perfect, that worked! Thanks a lot.

GI

-- 
Vader: I don't like the idea of you dating a smuggler.
Leia: Well, let's ask Mom what she thinks ... oh wait.
Vader: THAT'S IT. GO TO YOUR ROOM
Leia: My room *was* on Alderaan.

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-01 18:56 zargs: Argument list too long gi1242+zsh
2019-03-01 21:04 ` dana
2019-03-02  2:30   ` gi1242+zsh

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/ public-inbox