1
  • 我的操作系统是win10 X64,并且我已经在 Windows 上的 Ubuntu 上安装了 Bash
  • 我的 IDE 是 Pycharm2017,我已经安装了 bash 插件BashSupport,如Shell Process.

我的测试文件helloworld.sh有这样的代码:

#!/usr/bin/env bash
echo "Hello, World!"

当我在 Pycharm 中运行此脚本时,结果如下:

C:\WINDOWS\system32\bash.exe E:/MyCodes/shell/hello-sh/hello.sh /bin/bash: E:/MyCodes/shell/hello-sh/hello.sh: 没有那个文件或目录

在此处输入图像描述

是否可以在像 Pycharm 这样的 IDE 中运行 bash 脚本?如何?

4

1 回答 1

0

在 WSL 下运行时,Windows 文件会挂载在 /mnt 上。
您需要将 E:/ 更改为 /mnt/e/

于 2018-02-25T03:30:47.637 回答