为什么Git Bash无法运行我的可执行文件?

编程入门 行业动态 更新时间:2024-10-26 14:29:42
本文介绍了为什么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无法运行我的可执行文件?

本文发布于:2023-07-07 09:07:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1061414.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可执行文件   Git   Bash

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!