icub-tech-iit / ergocub-gazebo-simulations

Repository containing the models and the simulations for ergoCub
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Adapt hold_box.sh script to run on Windows #33

Closed traversaro closed 2 years ago

traversaro commented 2 years ago

This permit to run the hold_box.script.sh experiment on Windows, as discussed in https://github.com/icub-tech-iit/ergocub-gazebo-simulations/issues/29#issuecomment-1067084821 .

The changes are the following:

The changes are unfortunatly far from being intuitive/mantainable, and this is the reason why for multiplatform multiprogram logic we use either yarpmanager of Python scripts that use the subprocess library ( https://docs.python.org/3/library/subprocess.html ).

Nicogene commented 2 years ago

The changes are unfortunatly far from being intuitive/mantainable, and this is the reason why for multiplatform multiprogram logic we use either yarpmanager of Python scripts that use the subprocess library ( https://docs.python.org/3/library/subprocess.html ).

You are right, if we want to invest time in multiplatform support we should replace the bash scripts. I can open an issue for tracking this activity @vvasco @vtikha In the meanwhile your changes @traversaro are fine! Merging

traversaro commented 2 years ago

Just for a reference on the strange escaping rule in Git Bash:

STraversaro@IITICUBLAP257 MINGW64 ~
$ TEST_VAR=/test cmd.exe /C "echo %TEST_VAR%"
C:/Program Files/Git/test

STraversaro@IITICUBLAP257 MINGW64 ~
$ TEST_VAR=/test/test2 cmd.exe /C "echo %TEST_VAR%"
C:/Program Files/Git/test/test2

STraversaro@IITICUBLAP257 MINGW64 ~
$ TEST_VAR=/test/test2:o cmd.exe /C "echo %TEST_VAR%"
/test/test2:o

STraversaro@IITICUBLAP257 MINGW64 ~
$ TEST_VAR=//test cmd.exe /C "echo %TEST_VAR%"
/test

STraversaro@IITICUBLAP257 MINGW64 ~
$ TEST_VAR=//test/test2 cmd.exe /C "echo %TEST_VAR%"
//test/test2

STraversaro@IITICUBLAP257 MINGW64 ~
$ TEST_VAR=//test cmd.exe /C "echo %TEST_VAR%"