Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Length of argument list
- X-seq: zsh-workers 35436
- From: Clint Hepner <clint.hepner@xxxxxxxxx>
- To: Manfred Lotz <manfred.lotz@xxxxxxxx>
- Subject: Re: Length of argument list
- Date: Wed, 10 Jun 2015 17:46:24 -0400
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=26oD633hohMrYD+F4uF4Uw9J5tbbh3bYtRvhZzcGiAs=; b=k6cYLyHLsfKqw6rPZZiHSdy9gF8m2hpapSVdBOSz4KcsC/l9iB9zGtGQyUo8KANCo7 MtGXqAbyKqZ9BU6hBzL/B6oLNn76ztLa0nv15ZmxscanBCFiLH78E1KiJiBmfclpCQBY 4MHauxTd9a76Sq0RT+ZDhD4rkE1EymAMZHJXAeY8VqVFlV28GFFl1VLDJBBkHI3EADB/ vgE68L+78oAn09mrq5UjAjsMqjMWQW0YVymyUI0sMC9rYeEH5XsJeV/lMdqm09U9ofdb IJGNamW5jg9OFAmZR/WKGL5KfGBaWnAliHmZcTpOwQV0FWUbR/YXLt6sOvOo3RqwcJIV BKPA==
- In-reply-to: <20150610204814.4aa2f5aa@hogwart.bsdlocal.net>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20150610204814.4aa2f5aa@hogwart.bsdlocal.net>
This is the wrong way to count files in the first place; any matching file
names containing newlines (yes, they're legal) would give the wrong count.
One alternative is
a=( manyfiles/* )
echo ${#a}
to create an array containing all the file names, then check the number of
elements in the array.
On Wed, Jun 10, 2015 at 2:48 PM, Manfred Lotz <manfred.lotz@xxxxxxxx> 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?
>
>
>
> --
> Manfred
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author