zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Manfred Lotz <manfred.lotz@arcor.de>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Length of argument list
Date: Wed, 10 Jun 2015 22:09:06 +0200	[thread overview]
Message-ID: <CAHYJk3R4pCYWths7g=Mfd+xDBAdxetHSusCyvq6P5KFrsd4DuQ@mail.gmail.com> (raw)
In-Reply-To: <20150610204814.4aa2f5aa@hogwart.bsdlocal.net>

On Wed, Jun 10, 2015 at 8:48 PM, Manfred Lotz <manfred.lotz@arcor.de> wrote:
> Hi all,
> I created 1 million files in a directory callend manyfiles/.
>
> Now
> ls manyfiles/* |wc -l
>
> gives
> zsh: argument list too long: ls
>
>
> Question: Is there a way to change the maximum size of the argument
> list?

That depends on your operating system, on linux it is guided by ulimit
-s (in particular, the argument list is a quarter of the stack size).
On other operating systems, the limit is traditionally quite small.
I'm assuming the above is just an example, but that particular thing
would be better handled by () { echo $# } manyfiles/*, or some
xargs/zargs contraption if you want to be more general.

-- 
Mikael Magnusson


  reply	other threads:[~2015-06-10 20:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10 18:48 Manfred Lotz
2015-06-10 20:09 ` Mikael Magnusson [this message]
2015-06-11  9:23   ` Manfred Lotz
2015-06-10 21:46 ` Clint Hepner
2015-06-11  9:27   ` Manfred Lotz
2015-06-11 13:20     ` Stephane Chazelas

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='CAHYJk3R4pCYWths7g=Mfd+xDBAdxetHSusCyvq6P5KFrsd4DuQ@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=manfred.lotz@arcor.de \
    --cc=zsh-workers@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).