From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13878 invoked from network); 31 Oct 2004 05:31:29 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 31 Oct 2004 05:31:29 -0000 Received: (qmail 28915 invoked from network); 31 Oct 2004 05:31:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 31 Oct 2004 05:31:22 -0000 Received: (qmail 26208 invoked by alias); 31 Oct 2004 05:31:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20536 Received: (qmail 26198 invoked from network); 31 Oct 2004 05:31:07 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 31 Oct 2004 05:31:07 -0000 Received: (qmail 28644 invoked from network); 31 Oct 2004 05:31:07 -0000 Received: from moonbase.zanshin.com (64.84.47.139) by a.mx.sunsite.dk with SMTP; 31 Oct 2004 05:31:05 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.13.1/8.13.1) with ESMTP id i9V5Uwmq013619; Sat, 30 Oct 2004 22:31:03 -0700 Date: Sat, 30 Oct 2004 22:30:58 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-workers@sunsite.dk To: Motoi Washida cc: zsh-workers@sunsite.dk Subject: Re: number of arguments zargs use In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 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.