cygwin environment variables set in bat file

流过昼夜 提交于 2019-12-23 19:38:48

问题


I need to set several environment variables that should be available in cygwin shell.

I tried running "c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/amd64"/vcvars64.bat in ~/.bashrc. Script seems to run but it does not update environment variables.

How can I export variables set in bat file?


回答1:


Depends upon what you are trying to do. If you want access to those tools within Cygwin you can edit your .bash_profile and update your PATH= to match what vcvars64.bat has. This is how I get access to those tools.

You can also run vcvars64.bat before starting Cygwin by editing your {cygwin dir}/Cygwin.bat (assuming you're starting Cygwin via this file!) to run it before starting bash. This way the DOS environment would be set and Cygwin would pick it up.



来源:https://stackoverflow.com/questions/15430807/cygwin-environment-variables-set-in-bat-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!