Need If condition in cmd

I need to run cmd with condition.

cmd:
- ‘if “${dir_params.os_is_windows}”
(for /L %i in (1, 1, ${data_params.cross_validation_pieces}) do (python -u src/segmentation_model_train_pipeline.py %i))
fi’

because the for loop only works in windows system and not on our linux server.

Hi. You can just put that into a wrapper script and use that instead.

but then I have to read params.yaml in that script.sh right?

Sorry, I’m not sure I follow. Please elaborate.

the original problem is that I need to use parameters modified in one stage in the next stage in a dvc.yaml
this can be done only by doing bash scripting, if I wrap the bash script and run it in cmd it solves initial problem.
Thank you