delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/07/03:25:00

Date: Thu, 7 May 1998 10:24:44 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Kbwms <Kbwms AT aol DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Knowledge Base Found & Difficulties with Start-up Code
In-Reply-To: <a36b2ee9.3550fe11@aol.com>
Message-ID: <Pine.SUN.3.91.980507102414.5259J-100000@is>
MIME-Version: 1.0

On Wed, 6 May 1998, Kbwms wrote:

> This problem is somehow connected to my Unix-like shell for DOS.  When
> make spawns a program under the shell (from Thompson Automation), it
> fails to receive a full complement of arguments.

Please tell me the details of how do you spawn a program.  A code
fragment which does that would be enough.  In particular, it matters
whether you use the library function `system' or one of the `spawnXX'
family to do that (the way this is handled by the library is
different).

You might also learn further about various aspects of this (or even
find a solution) by reading the libc reference, under `system' and
`spawnXX'.  Should you need to know more, the library sources tell the
whole story (look for src/libc/ansi/stdlib/system.c and
src/libc/dos/process/dosexec.c).

If you run the child program with `system', one possibility is that
`system' calls the shell to do everything, if it decides that your
shell's name looks like a Unixy shell.  If that's the case, your shell
needs to be told that DJGPP programs are to be passed arguments via
response files, like this:

       prog @file

and it should put all the arguments on that response file.  This is
because that shell is probably a non-DJGPP program, and so it doesn't
support the other DJGPP ways of passing long command lines.

>  When I switch to a
> DOS window, my program receives all 38 arguments.  This is ironic since
> the shell is supposed to have a huge buffer for arguments - something
> like 1840 characters for a single command.  I am seeking assistance from
> the supplier, as you might imagine.

I'm guessing that the problem is not in the shell, but in how it passes
arguments to DJGPP programs.

Btw, there is an excellent DJGPP port of Bash (v2gnu/bsh1147b.zip)
which you might try using.  When running DJGPP programs, this is IMHO
the best shell you could use, since it fully supports all DJGPP
features, both interactively and in batch mode.  I have been using it
for almost two years running extremely complex Unix shell scripts
almost unaltered, even on plain DOS, with no significant problems.

- Raw text -


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