On Wed, 23 Jun 2021, Allin Cottrell wrote:
On Wed, 23 Jun 2021, Sven Schreiber wrote:
> [L]et me give you a more complete self-contained example:
>
> ! "c:\Programme\LyX 2.3\Python\python.exe" c:\users\public\uhu.py >
> c:\users\public\testout\haha.txt
>
> The file uhu.py just contains the statement print(5), and the testout
> directory exists alright. This call from a gretl script works OK as
> written above, where only the path to python.exe is quoted. As described
> before, it fails if I enclose the other paths in quotes. (But both work
> directly in Windows's cmd prompt.)
OK, thanks for the example. I've verified that an analogous shell
call, with all three elements quoted, works OK on Linux. But I've
still to experiment on Windows.
Now I see that this sort of thing does not work on Windows. My test
example was a trivial program, printarg.exe, which prints out its
first argument. My "shell" line in gretl read thus:
! "c:\users\cottrell\printarg.exe" "foo" >
"c:\users\cottrell\print.out"
Gretl takes this input and turns it into the following request to
the operating system (with trailing backslash indicating line
continuation):
C:\WINDOWS\system32\cmd.exe /c "c:\users\cottrell\printarg.exe" \
"foo" > "c:\users\cottrell\print.out"
which looks OK to me. But Windows comes back with:
<windows>
C:\WINDOWS\system32\cmd.exe /c "c:\users\cottrell\printarg.exe" \
"foo" 1>"c:\users\cottrell\print.out"
'c:\users\cottrell\printarg.exe" "foo' is not recognized as an
internal or external command, operable program or batch file.
</windows>
That is, the first two double-quoted elements of the command line
have been run together by the OS in a way that's not easy to
understand.
If you'd like to contribute to getting this working on Windows,
please research the required cmd.exe syntax and let me know what we
need to do.
Allin