Mail Archives: djgpp/2003/01/29/08:30:06
"Charles Sandmann" <sandmann AT clio DOT rice DOT edu> wrote in message
news:3e37507d DOT sandmann AT clio DOT rice DOT edu...
> > I tried using your suggestion in various ways, but in each
> > case it seems that, although cmd.exe is called at some point
> > and displays its version, etc., it never exits, so that each
> > time it is called another shell instance is opened. In the
> > end I have had to type "exit" several times to exit the DOS
> > window. This is Windows 2000 Pro, SP2.
>
> Try
> SET SHELL=%COMSPEC% /C
> which seems to work better.
>
> It did something useful in my test case, instead of just ignoring
> the command and spawning CMD
I did try this but as Eli says in his posting, I don't
think that SHELL= should take parameters such as /C.
In MSDOS config.sys files the only parameters that
SHELL usually takes are /e or /p but it does depend on
what the shell is. The /e and /p are correct for
command.com in MSDOS.
A further experiment, prompted by a posting in
comp.lang.awk (where this all started out) by Andrew
Graham gives this odd looking result:
c:\>ver
Microsoft Windows 2000 [Version 5.00.2195]
c:\>echo %COMSPEC%
C:\WINNT\system32\cmd.exe
c:\>gawk "BEGIN{print ENVIRON[\"COMSPEC\"]}"
C:\WINNT\SYSTEM32\COMMAND.COM
c:\>
i.e., despite ver and echo %COMSPEC% saying that
we're using cmd.exe, DJGPP gawk's ENVIRON array
thinks that we're using COMMAND.COM
Is it possible that there's a bug in DJGPP libc's
system() call? I've d/l'd a copy of Andrew's latest
version as per his post: it has a date of 24/01/02
and the test shown above gives the same result.
It looks as if Eli's comment that there is a bug
somewhere is correct. It could be in the way that
gawk obtains the information for its ENVIRON array,
but as I don't have the sources for the DJGPP v2.04
gawk-3.1.1 I am not able to check this.
BTW I know that SP3 for W2K has a revised COMMAND.COM
according to the M$ site, but I don't think that this
is causing the discrepancy between echo %COMSPEC% and
gawk's ENVIRON array that we are seeing here.
Thanks to Eli, Charles and Andrew for the help and
advice.
Regards,
Peter
--
Peter S Tillier
"Who needs perl when you can write dc and sokoban in sed?"
- Raw text -