Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: number of arguments zargs use
- X-seq: zsh-workers 20536
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Motoi Washida <a66@xxxxxxxxxxxxx>
- Subject: Re: number of arguments zargs use
- Date: Sat, 30 Oct 2004 22:30:58 -0700 (PDT)
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <DE201C1C-2A7B-11D9-A1A8-000D93502E64@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <DE201C1C-2A7B-11D9-A1A8-000D93502E64@xxxxxxxxxxxxx>
- Reply-to: zsh-workers@xxxxxxxxxx
On Sat, 30 Oct 2004, Motoi Washida wrote:
> This tries to get size of arguments allowed. I don't know this is
> portable enough, but it seems to work for me.
This set me off wandering down the road to Obfuscatory ...
s=${${s##-(s|-max-chars(=|))}:-$(((s=$({command getconf ARG_MAX ||
command sysctl -n kern.argmax || echo 0} 2>/dev/null))?
(s-=${#$(builtin typeset +x)}+2048):20480))}
That would be equivalent to, though significantly less readable than,
your patch, except that there is a bug in your patch:
> + else
> + s=-20480
> + fi
That should be "s=20480", not -20480. You'd never want a negative number
of characters.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author