From: "Peter S Tillier" Newsgroups: comp.os.msdos.djgpp Subject: Re: gawk 3.1.1 DJGPP v2.04 on Windows 2000 Pro problem using system() function and LFNs Date: Tue, 28 Jan 2003 19:07:53 -0000 Organization: Private Lines: 116 Message-ID: References: <3e360683 DOT sandmann AT clio DOT rice DOT edu> NNTP-Posting-Host: eq1152.demon.co.uk X-Trace: news.demon.co.uk 1043781845 13358 158.152.22.92 (28 Jan 2003 19:24:05 GMT) X-Complaints-To: abuse AT demon DOT net NNTP-Posting-Date: Tue, 28 Jan 2003 19:24:05 +0000 (UTC) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Charles Sandmann" wrote in message news:3e360683 DOT sandmann AT clio DOT rice DOT edu... > > My suspicion was that the system() command in gawk was > > invoking command.com rather than cmd.exe, although I > > assume that the value of COMSPEC would be checked by > > the gawk code. > > Try: > SET SHELL=%comspec% > > before running. Don't have time to try it, but I'm curious if it > makes a difference. > Hi Charles, (Apologies for calling you Chris in my previous response.) 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. Here's one session as an example (sorry if it wraps in posting): Beginning of session clip ---------------------------- C:\djgpp\home\pt>dir Volume in drive C has no label. Volume Serial Number is D8C4-E33B Directory of C:\djgpp\home\pt 28/01/2003 11:12 . 28/01/2003 11:12 .. 23/01/2003 12:50 271 lfntest.awk 23/01/2003 12:58 281 lfntest2.awk 23/01/2003 10:38 41 long file name.txt 28/01/2003 11:12 64 mytest.bat 28/01/2003 11:17 106 quite a long file name.log 5 File(s) 763 bytes 2 Dir(s) 7,263,513,088 bytes free C:\djgpp\home\pt>set SHELL=%COMSPEC% C:\djgpp\home\pt>gawk -f lfntest.awk Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp. C:\djgpp\home\pt>dir Volume in drive C has no label. Volume Serial Number is D8C4-E33B Directory of C:\djgpp\home\pt 28/01/2003 11:12 . 28/01/2003 11:12 .. 23/01/2003 12:50 271 lfntest.awk 23/01/2003 12:58 281 lfntest2.awk 23/01/2003 10:38 41 long file name.txt 28/01/2003 11:12 64 mytest.bat 28/01/2003 11:18 106 quite a long file name.log 5 File(s) 763 bytes 2 Dir(s) 7,263,513,088 bytes free C:\djgpp\home\pt>set ALLUSERSPROFILE=C:\DOCUME~1\ALLUSE~1 APPDATA=C:\DOCUME~1\pt\APPLIC~1 COMMONPROGRAMFILES=C:\PROGRA~1\COMMON~1 COMPUTERNAME=pt ComSpec=C:\WINNT\system32\cmd.exe HOMEDRIVE=C: HOMEPATH=\ NUMBER_OF_PROCESSORS=1 OS=Windows_NT OS2LIBPATH=C:\WINNT\system32\os2\dll; PATH=C:\Perl\bin\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\W INNT\sy stem32\nls\English;C:\PROGRA~1\SUPPOR~1\ PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 6, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=0806 PROGRAMFILES=C:\PROGRA~1 PROMPT=$P$G SHELL=C:\WINNT\system32\cmd.exe SYSTEMDRIVE=C: SYSTEMROOT=C:\WINNT TEMP=C:\WINNT\TEMP TMP=C:\WINNT\TEMP USERNAME=pt USERPROFILE=C:\DOCUME~1\pt C:\djgpp\home\pt>exit C:\djgpp\home\pt> End of session clip ------------------------------------- I also tried putting the SET command that you suggested into a batch file and running that from a CMD.EXE prompt, with similar results. TIA for any further advice or assistance. Regards, Peter -- Peter S Tillier "Who needs perl when you can write dc and sokoban in sed?"