Iron Spring Software wrote on 01 Apr 2021:
Is there a way to get a fully-parsed command line, with wildcard
expansions, etc. from command.exe? For PL/I I have been using the
command as typed from pib_pchcmd as the parm to the main procedure, but
for compatibility with unix I'd like to also get argc and argv.
Peter,
If you can find a copy of the UNIX Shell I ported/wrote for MS-DOS (but
also got to work on OS/2, WinNT), there is a source file in there which
may help you. You need: ms_sh23s.zip (I found a copy under
https://ftp- os2.nmsu.edu/download/pub/os2/util/shell/ of all places). The main
source is a replacement for stdargv - stdargv.c, but you may need some of
the other files (director.c, etc.). I've not looked at this for over 15
years, but at the time, I used it by replacing the MS/IBM object in the approach library. Whether it still works, I've no idea - not really used
OS/2 for years.
From memory, the only this I did was compile it, replace the version in
the library and then any executable built using that library did a unix-
like command line expansion - it even handled quotes. Only thing to
beware of it that it uses UNIX directory separators and backslashes as
escapes. From memory, OS/2 worked with either / or \ as the directory separator, but I may be wrong. In which case, it's left as an exercise
for the keen student to covert appropriately.
Hope this helps.
Regards
Ian.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)