vefatica wrote:
> >> Why doesn't this work?
> >>
> >> v:\> 1>file (for /L %i in (0,1,2) do echo %i)
> >> Usage : FOR [/A:[[-][+] ...
> >>
> >> It works in CMD.EXE and with other TCC commands.
> >---End Quote---
> >Your redirection syntax is meaningless - what are you actually trying
> to do?
>
> How is it meaningless? It works (TCC):
>
> v:\> 1>file (date /t)
>
> v:\> type file
> Wed 2008-06-04
First, it's meaningless because you're asking the parser to redirect
STDOUT to STDOUT and then on to FILE. Lose the "1".
The second problem is with the overall line syntax. Because you put the
redirection at the beginning of the line (undocumented behavior), the
parser has no way of knowing that you're (eventually) going to want to
run a FOR, so it does variable expansion on the whole line, causing the
%i arguments to be prematurely expanded. You either need to double up
the %'s or eliminate the command grouping and put the redirection at the
end of the line.
Rex Conn
JP Software