mawk 1.3.4 20240622 for DOS (Announce)
> What, the extra "/c"? Although I may be misunderstanding, as you know
> "%COMSPEC% /c my.bat" is often how most programs shell out. But you don't
> need to explicitly call the shell if not using a .BAT file.
>
> In other words, some compilers treat system("runme") as system("command /c
> runme"). They don't try to be clever and only do it for .BATs, they do it
> for everything. (DJGPP is a little smarter than most here.) In particular,
> Turbo Pascal's Exec function (in most, but not all, TP-compatible
> compilers) explicitly needs something like Exec(getenv('COMSPEC'),' /c ' +
> myEXEname);
I ran this again, this time in the WinPE command prompt, with the following results.
C:\hxtest\win32>test.exe foo bar >test.txt
C:\hxtest\win32>type test.txt
COMSPEC=X:\i386\system32\cmd.exe
argc=3
argv[0]=C:\hxtest\win32\test.exe
argv[1]=foo
argv[2]=bar
C:\hxtest\win32>test2.exe test.exe foo bar ">test2.txt"
C:\hxtest\win32>type test2.txt
COMSPEC=X:\i386\system32\cmd.exe
argc=3
argv[0]=C:\hxtest\win32\test.exe
argv[1]=foo
argv[2]=bar
Interesting that argc=3 when running test2.exe on Windows, but argc=5 when running test2.exe on HXRT. This leads me to believe that the blame rests somewhere other than the OpenWatcom compiler.
Complete thread:
- mawk 1.3.4 20240622 for DOS - bencollver, 15.08.2024, 03:27 (Announce)
- mawk 1.3.4 20240622 for DOS - Rugxulo, 15.08.2024, 06:57
- mawk 1.3.4 20240622 for DOS - bencollver, 15.08.2024, 16:27
- mawk 1.3.4 20240622 for DOS - Rugxulo, 15.08.2024, 16:40
- mawk 1.3.4 20240622 for DOS - bencollver, 15.08.2024, 17:33
- mawk 1.3.4 20240622 for DOS - Rugxulo, 16.08.2024, 04:21
- mawk 1.3.4 20240622 for DOS - bencollver, 16.08.2024, 04:45
- mawk 1.3.4 20240622 for DOS - Oso2k, 16.08.2024, 15:27
- mawk 1.3.4 20240622 for DOS - Rugxulo, 25.08.2024, 01:09
- mawk 1.3.4 20240622 for DOS - Japheth, 25.08.2024, 07:04
- mawk 1.3.4 20240622 for DOS - Rugxulo, 16.08.2024, 04:21
- mawk 1.3.4 20240622 for DOS - bencollver, 15.08.2024, 17:33
- mawk 1.3.4 20240622 for DOS - Rugxulo, 15.08.2024, 16:40
- mawk 1.3.4 20240622 for DOS - bencollver, 20.08.2024, 03:35
- mawk 1.3.4 20240622 for DOS - Japheth, 20.08.2024, 13:27
- mawk 1.3.4 20240622 for DOS - bencollver, 21.08.2024, 00:38
- mawk 1.3.4 20240622 for DOS - Rugxulo, 21.08.2024, 12:50
- mawk 1.3.4 20240622 for DOS - Japheth, 21.08.2024, 17:02
- mawk 1.3.4 20240622 for DOS - bencollver, 21.08.2024, 18:55
- mawk 1.3.4 20240622 for DOS - Rugxulo, 21.08.2024, 23:25
- mawk 1.3.4 20240622 for DOS - bencollver, 22.08.2024, 02:09
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 00:55
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 03:08
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 08:14
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 17:34
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 19:22
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 19:53
- mawk 1.3.4 20240622 for DOS - Japheth, 03.09.2024, 21:26
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 19:53
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 19:22
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 17:34
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 08:14
- mawk 1.3.4 20240622 for DOS - bencollver, 23.08.2024, 03:08
- mawk 1.3.4 20240622 for DOS - Japheth, 23.08.2024, 00:55
- mawk 1.3.4 20240622 for DOS - bencollver, 22.08.2024, 02:09
- mawk 1.3.4 20240622 for DOS - Rugxulo, 21.08.2024, 23:25
- mawk 1.3.4 20240622 for DOS - bencollver, 21.08.2024, 18:55
- mawk 1.3.4 20240622 for DOS - bencollver, 21.08.2024, 00:38
- mawk 1.3.4 20240622 for DOS - Japheth, 20.08.2024, 13:27
- mawk 1.3.4 20240622 for DOS - bencollver, 15.08.2024, 16:27
- mawk 1.3.4 20240622 for DOS - bencollver, 24.08.2024, 04:55
- mawk 1.3.4 20240622 for DOS - Rugxulo, 24.08.2024, 13:34
- mawk 1.3.4 20240622 for DOS - bencollver, 24.08.2024, 18:05
- mawk 1.3.4 20240622 for DOS - Rugxulo, 24.08.2024, 13:34
- mawk 1.3.4 20240622 for DOS - Rugxulo, 15.08.2024, 06:57