Re: Is there a way to create a SUB without using a temp file
Posted: 31 Jan 2012 03:20
aGerman wrote:There is no COPY without a resulting file Unfortunately I have no further idea.
What's with
Code: Select all
copy /a nul+nul CON
The only bad thing is that CON is a text device that stops at the first CTRL-Z, so I can't get the output with a FOR-Loop
dbenham wrote:within a batch file functions like a cross between white space and a command concatenation operator
But it doesn't play nicely with FOR /F
Somewhere, sometimes I posted it, but as always I can't find it anymore.
The rule for SUB is:
The batch-parser substitutes a SUB character with a single linefeed character, but only after the read phase, before the percent expansion phase begins
This seems to be the only thing that happens there, even the CR is removed later.
So the normal rules of the linefeed are active here.
Code: Select all
@echo off
echo oneecho two
set MultiLine^
var=content
set multi
echo ##%MultiLine^Var%
jeb