|I'm looking for an easy way to avoid the following problem:|
Suppose I have a variable:
And I redirect that variable to a file:
C:\>echo %var% > test.xxx
That all works :
But, I don't want a trailing space in my file, so I glue the redirection to the content of the variable (here called "var"). From the above command, you see that in this example, that value is set to : 1
C:\>echo %var%> test.xxx
And now, the result is that no file is written, because the command is parsed as:
C:\>echo 1> test.xxx
And that indeed, results in :
ECHO is on.
But obviously, I want the variable's value in my file.
Obviously, if you put other content in the variable, there is no issue, but there is for specific values, like the one I used in the example.
How do I avoid that problem ? I want the command to be robust, so that I can put any value in the variable, and it will do as I want.
message edited by tvc