- Jun
- 42
- 0
I have the following alias, all one line (note the backticks):
I would like to define it on the fly in a batch file, and have been unable to do so, except by writing it out to a file first.
Doesn't work (inner set of backticks are lost):
Doesn't work (prints escape char, or something, as part of output):
Removing outer backticks and doubling percents results in something similar.
This works, but is unwieldy:
Any suggestions?
- Josh
Code:
columns = for %line in (@con) do ( ( for %field in (%line) do echos %@format[-%1, %field] `` ) %+ echo. )
I would like to define it on the fly in a batch file, and have been unable to do so, except by writing it out to a file first.
Doesn't work (inner set of backticks are lost):
Code:
columns = `for %line in (@con) do ( ( for %field in (%line) do echos %@format[-%1, %field] `` ) %+ echo. )`
Doesn't work (prints escape char, or something, as part of output):
Code:
columns = `for %line in (@con) do ( ( for %field in (%line) do echos %@format[-%1, %field] %=`%=` ) %+ echo. )`
Removing outer backticks and doubling percents results in something similar.
Code:
columns = for %%line in (@con) do ( ( for %%field in (%%line) do echos %%@format[-%%1, %%field] %=`%=` ) %%+ echo. )
This works, but is unwieldy:
Code:
text > %temp\%@name[%_batchname].alias
columns = for %line in (@con) do ( ( for %field in (%line) do echos %@format[-%1, %field] `` ) %+ echo. )
endtext
alias /r %temp\%@name[%_batchname].alias
del /q %temp\%@name[%_batchname].alias
Any suggestions?
- Josh