L
Liviu
"C:>echo 123 | set /p xyz=" at a cmd prompt doesn't set/change "xyz".
Is there another way to set a variable from piped standard input
(without temp files etc)? Question is related to
http://www.robvanderwoude.com/variableexpansionbug.html, and could have
interesting uses inside a "for" with enabledelayedexpansion, for example
--------
@echo off
echo.
setlocal enabledelayedexpansion
for %%x in ("%%^^&^!") do (
echo "%%~x"
(echo "%%~x") | more
)
--------
gives
--------
"%&"
"%^&!"
--------
where the second line could be useful if "captured" into a variable.
Cheers,
Liviu
Is there another way to set a variable from piped standard input
(without temp files etc)? Question is related to
http://www.robvanderwoude.com/variableexpansionbug.html, and could have
interesting uses inside a "for" with enabledelayedexpansion, for example
--------
@echo off
echo.
setlocal enabledelayedexpansion
for %%x in ("%%^^&^!") do (
echo "%%~x"
(echo "%%~x") | more
)
--------
gives
--------
"%&"
"%^&!"
--------
where the second line could be useful if "captured" into a variable.
Cheers,
Liviu