Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't Git Bash run my executable?

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

Why is it so?

like image 344
Pedro OS Avatar asked Apr 22 '15 17:04

Pedro OS


People also ask

How do I run an application in Git Bash?

Step 1: Go to Github repository and in code section copy the URL. Step 2: In the Command prompt, add the URL for your repository where your local repository will be pushed. Step 3: Push the changes in your local repository to GitHub. Here the files have been pushed to the master branch of your repository.


2 Answers

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

$ ./sqlite3.exe 

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.

like image 152
Nattgew Avatar answered Sep 21 '22 09:09

Nattgew


It's because you're under a is a runtime environment for gcc, that give you support to binaries native under Windows, but you can run any exe as shell using ./ (local execute) Take a look to documentation of this tool: http://sourceforge.net/p/mingw-w64/wiki2/FAQ/

like image 30
Alvarova Avatar answered Sep 18 '22 09:09

Alvarova