Re: Windows 2000 and XP and exec and double quotes
From: Benjamin Riefenstahl (Benjamin.Riefenstahl_at_epost.de)
Date: 01/28/04
- Next message: Cameron Laird: "Re: A question about "Read"..."
- Previous message: Benjamin Riefenstahl: "Re: Not *too* far off-topic: Windows and Postscript printers"
- In reply to: Richard Auletta: "Re: Windows 2000 and XP and exec and double quotes"
- Next in thread: Richard Auletta: "Re: Windows 2000 and XP and exec and double quotes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Jan 2004 12:28:43 +0100
Hi Richard,
rauletta@viawest.net (Richard Auletta) writes:
> Here is TCL:
>
> % exec cmd.exe /c echo hello
> hello
> % exec cmd.exe /c echo hello
> hello
> % exec cmd.exe /c echo "hello"
> hello
These look all correct to me. On the Tcl level the literal constants
hello, "hello" and {hello} mean the same string.
> % exec cmd.exe /c echo \"hello\"
> \"hello\"
> % exec cmd.exe /c echo {"hello"}
> \"hello\"
>
> This last one strikes me very odd.
These two are indeed where you hit the problem in Windows [exec].
Note that, as I said before, quotes can not occur in Windows filenames
(try it from Explore or from CMD.EXE, if you don't believe me), so the
fact that [exec] escapes quotes is not a problem with filename
parameters.
> As to why I want to include double quotes, that is what
> ntbackup wants.
Does ntbackup explicitly want quotes (like the FIND command does it)?
In that case you are hosed, because you can control the quoting the
[exec] does with that kind of detail.
OTOH, if ntbackup only needs quotes, iff the parameter contains
spaces, that is exactly how [exec] works, so this would not be a
problem.
> From the doc, clearly the " are in bold and are required (though not
> if the value does not contain spaces.)
Than everything is fine.
You can try out what actually happens, if you replace ntbackup with
this little batch instead:
>>>>>>> test.bat <<<<<<
@echo off
echo.|time >> c:\tmp\test.bat.log
echo %0 %* >> c:\tmp\test.bat.log
echo ----- >> c:\tmp\test.bat.log
>>>>>>> end of test.bat <<<<<<
benny
- Next message: Cameron Laird: "Re: A question about "Read"..."
- Previous message: Benjamin Riefenstahl: "Re: Not *too* far off-topic: Windows and Postscript printers"
- In reply to: Richard Auletta: "Re: Windows 2000 and XP and exec and double quotes"
- Next in thread: Richard Auletta: "Re: Windows 2000 and XP and exec and double quotes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|