delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/03/12/13:07:11

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <BC46D442BCFB6340A9BB1CED6766E36E024E702B@tons2226>
From: "Willis, Matthew" <Matthew DOT Willis AT CIBC DOT ca>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: RE: cygwin 1.3.20-1 - strange problems with long command lines in
nt4
Date: Wed, 12 Mar 2003 13:00:58 -0500
MIME-Version: 1.0

> Igor wrote:
> You may be hitting the command-line limit with bash.  Try the above with
> cmd.exe.  See below.
>> c:\cygwin\bin\echo.exe %PATH%        -- works fine
>> c:\cygwin\bin\echo.exe %PATH%%PATH%  -- fails, immediately returns to
command line
>
>Try stracing the last line above...
>	Igor

I can replicate the behavior in cmd.exe; strace returns a zero byte file. 

C:\>c:\cygwin\bin\strace.exe -o foo.txt c:\cygwin\bin\echo.exe %PATH%
C:\texmf\miktex\bin;C:\WINNT\system32;C:\WINNT;c:\FpAddin;c:\FpAddinLon;C:\w
in32
app\Sybase\DLL;C:\win32app\Sybase\BIN;C:\FpAddin;C:\OptexNT\vendordll;C:\Opt
exNT
\dll;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program
File
s\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft
Visual S
tudio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin

C:\>c:\cygwin\bin\wc.exe foo.txt
    269    2712   27213 foo.txt

C:\>c:\cygwin\bin\strace.exe -o foo.txt c:\cygwin\bin\echo.exe %PATH%%PATH%

C:\>c:\cygwin\bin\wc.exe foo.txt
      0       0       0 foo.txt

Interestingly, I /can/ pass long command lines with bash to programs built
using vc++. I built a test prog (myecho.exe) using vc++, 

/* myprog.c */
int main(int argc, char* argv[])
{
  for (int i=0;i<argc; i++) printf("%s ",argv[i]);
  printf("\n");
  return 0;
}

which will run when I pass long arguments using bash.exe as my shell. I can
also pass long arguments to this program under cmd.exe. The only difference
seems to be that bash.exe fully expands argv[0] to the full win32 path name
and cmd.exe leaves it as myecho.exe. In both cases I was able to use command
lines over 2000 bytes long without problems.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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