optional debug method
Posted: 25 Mar 2022 06:02
Have large redistributional (zipfile with .cmd file and few bundled console utilities) batch script, where many times commands are processed in FOR loop with its output parsing. Informations readed by command are often HW (drivers) based so output may vary case by case unpredictible.
Thinking about to offer some optional debug method for script users which duplicate command output to STDOUT and debug file by (bundled) tee utility.
Thinking about something like this:
and to script loops append %tee%
is this suitable way to process for loop output AND copy its output to file? Aby better solution?
Thinking about to offer some optional debug method for script users which duplicate command output to STDOUT and debug file by (bundled) tee utility.
Thinking about something like this:
Code: Select all
if %1 == -d set "tee=^| utils\tee.exe debug.txt"
Code: Select all
for /f %a in ('command1 par1 par2 ^| command2 par1 par2 %tee%') do something