'input.txt':
Code: Select all
test1
test2
test3
Code: Select all
FOR /F %A IN (input.txt) DO @ECHO -%A
-test1
-test2
-test3
FOR /F %A IN ('TYPE input.txt') DO @ECHO -%A
-test1
-test2
-test3
Code: Select all
SET str=test1 test2 test3
FOR /F "tokens=1-3" %A IN ("%str%") DO @(
More? ECHO -%A
More? ECHO -%B
More? ECHO -%C
More? )
-test1
-test2
-test3
Code: Select all
str="test1 test2 test3"
for a in $str; do echo -$a; done
-test1
-test2
-test3
Code: Select all
SET str=test1 test2 test3
FOR /F %A IN ('ECHO.%str: =^&ECHO.%') DO @ECHO -%A
-test1
-test2
-test3