delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/10/26/12:14:28

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type; q=dns; s=default; b=Pi9e
zsfbWRXAzIXad7upGSSAFW42PZCCLxCVSi+wjE4jqiE5QIs0JcrvZJTH84LQSk5d
cXqdE9kQc11UX79OPwCMe2TbcBvy7O211dhhABbmY6DYP5tI+ybbrsmNjS0UdnSl
o73hH1bNafYVGLX9DaZ8ZJL2EelAxi9k89UZ/yw=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type; s=default; bh=16wiQ2xE8k
SEaefYxh2cnJFUXaM=; b=b/Ap8Iwc9jh/QGR/6DXlwF4Xrzyv5DmVM0Zs/u0WhN
8TaWX+pWjI4G7um/Qf7RnG5GuF4fobB1uwZo8aT5JchbBZiSjXol9/8j2KUzM9oR
CCjeSm3WkInnuLfaPP92szqtB0fiRRnyNl5K1IeiK3FqZYf9l1ILqpz78IGmJrdZ
g=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2
X-HELO: mx1.redhat.com
Subject: Re: Command line length in Ash or Dash Shells
To: cygwin AT cygwin DOT com
References: <22062 DOT 2952 DOT 946000 DOT 358554 AT woitok DOT gmail DOT com>
From: Eric Blake <eblake AT redhat DOT com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
X-Enigmail-Draft-Status: N1110
Message-ID: <562E514E.4000801@redhat.com>
Date: Mon, 26 Oct 2015 10:14:06 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <22062.2952.946000.358554@woitok.gmail.com>
X-IsSubscribed: yes

--V18xR2FwRUqK78dNKpE2QILlMouhpELm0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 10/26/2015 05:16 AM, Dr Rainer Woitok wrote:
> Does anybody definitely know about a  maximum command line length in the
> Ash or Dash Shells?

/bin/ash _is_ the same as /bin/dash, so there is no difference in their
behavior.

A windows process spawning a cygwin one, or a cygwin process spawning a
windows process, are both subject to Window's limits.  I'm not sure
off-hand what the actual limit is, but seem to recall the figure of 64k
as the combined limit for both argv and environ (that is, your command
line length limit IS affected by how much is also in your environment
variables at the time).  And since you quoted even lower numbers for
batch files, that is entirely possible that the Windows command line
limit is not the only limit you will hit (I avoid batch files when
possible, so I can't confirm the numbers you quoted).

One cygwin process spawning another has no inherent command line limit,
because cygwin processes use a back door in shared memory, rather than
the normal Windows command line storage, to pass their command line
arguments (in part because the windows limits are so pathetic).  So once
you start a dash shell, that dash shell can start any number of other
dash shells with no command line length limit other than the memory
available to your machine.

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--V18xR2FwRUqK78dNKpE2QILlMouhpELm0
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJWLlFOAAoJEKeha0olJ0Nqr3wH/i+sWXSCIze2kAbWK8DlYFDz
LVGgkkRL+Aegh3BhWwx/yez8LO1y/IKQQpG+Cmyvdf32ZDZEinpdEmkjeROMkgPb
aUZqS3Z2gqnRki1P+lf6TVEs7cRUzjCcY4Cr/klFO2P1ywnNY8fRZ24TJH7cBmmd
MadjpDCMQH+ELkSH9NiMwfFL36sScpxQrRFQ2DFqxIEtk3vXXqdES/RpqZQy9ArC
l02b2qGP7muaJyx4tfuOba2HnOzTVKa8A8brc5YImsVl2XdhsSV3bz1fDt8PBUu9
Rz3oqQwp9zXo7b1qjVBQMRKF1eG5Xof2y/kVNDYKMCMgb6TumeKIv9BJq4QGvi0=
=GLe1
-----END PGP SIGNATURE-----

--V18xR2FwRUqK78dNKpE2QILlMouhpELm0--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019