I'm doing a script that I start with
bash.exe from Cygwin on Windows:
It changes my Python Virtual Env depending of some conditions. For those who know Virtualenv, I need to use "workon.bat" and the only way I know to execute a batch script is the following one:
... cmd /K "workon.bat" "$required_venv" ...
It works but I'm now in a new
cmd.exe instance launched from the previous one. Proof : Typing
exit bring me back to it :
C:\bash.exe my_script.sh *ENTER* (venv) C:\ (venv) C:\exit *ENTER* C:\
In fact, each time I will launch that script I will be in a new instance :
cmd.exe cmd.exe cmd.exe cmd.exe ...
How to solve that annoying recursive situation ? One solution could be to detect that I'm in a cmd launched into another one and exit. I would be ideal to execute the batch workon.bat while remaining inside the cmd.