windows10 bash命令无法通过`-c`参数读取PATH环境

时间:2017-06-16 01:47:43

标签: windows bash shell powershell

我在windows10 professional上安装了ubuntu bash。我在~/.bashrc上添加了以下代码:

export PATH=/opt/mongo/bin:$PATH

当我启动bash时,我可以在该bash中运行mongod命令。但我无法通过Windows命令终端运行mongod命令,如下所示:

>bash -c "mongod"
/bin/bash: mongod: command not found

似乎在通过-c参数运行bash命令时,PATH变量不会更新。这有什么问题?如何通过windows normal命令终端运行它?

0 个答案:

没有答案