FreeDOS invalid syntax for /f

1

I got a script that uses for /f in Windows. However, FreeDOS doesn't seem to support the syntax /f and it is only supported in Windows emulated cmd.

for /f "tokens=4" %%i in ('all.bat') do set RESULT=%%i

This commands tells it to pick the fourth word and set it as a variable. I've tested it in cmd and it works, but now I need to put it into a bootable FreeDOS USB stick.

lbanz

Posted 2015-02-05T18:41:18.700

Reputation: 141

1Is there a reason you can't use a FreeDOS boot stick? – dsolimano – 2015-02-05T20:07:47.177

Sorry, it is a typo. I'm using FreeDOS but it doesn't support the /F syntax which apparently only works in cmd. I need to grep a line and set it as a variable. – lbanz – 2015-02-06T09:35:18.477

If your question is wrong, then [edit] it to correct it. – JdeBP – 2015-02-06T10:16:06.700

@lbanz: Is an MS-DOS USB stick not an option? – Karan – 2015-04-08T18:09:25.933

Answers

1

According to FreeDOS Help, the for command runs a specified command for each file in a set of files. Does not appear additional switches like /F to run it against the results of another command...

JosefZ

Posted 2015-02-05T18:41:18.700

Reputation: 9 121