为什么Git Bash无法运行我的可执行文件? [英] Why can't Git Bash run my executable?

查看:735
本文介绍了为什么Git Bash无法运行我的可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 git-for-windows Git Bash上.我无法在命令行上运行可执行文件:

I am on git-for-windows Git Bash. I can't run an executable on the command line:

Pedr@Abc-07 MINGW64 /c/dev
$ ls sqlite3.exe
sqlite3.exe*

Pedr@Abc-07 MINGW64 /c/dev
$ sqlite3
bash: sqlite3: command not found

为什么会这样?

推荐答案

要在bash中的当前目录中运行程序,请将./放在它的前面.因此,在您的情况下:

To run a program in the current directory in bash, you put ./ in front of it. So in your case:

$ ./sqlite3.exe

运行sqlite3时,bash会在PATH环境变量的所有目录中查找具有该名称的程序,默认情况下,该目录包含可执行文件(如/usr/local/bin)的标准位置,但不包括当前目录. 请参阅此处以获取更多信息.

When you run sqlite3, bash will look for a program with exactly that name in all directories of the PATH environment variable, which by default includes standard locations for executables like /usr/local/bin but not your current directory. See here for more info on that.

这篇关于为什么Git Bash无法运行我的可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆