Why can't Git Bash run my executable?

前端 未结 3 1144
挽巷
挽巷 2021-01-31 01:39

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          


        
3条回答
  •  感情败类
    2021-01-31 02:06

    Your PATH is missing ./. Add it to your .profile file in the home directory (/c/Users/username):

    $ cd
    $ pwd
    /c/Users/username
    $ echo 'PATH=$PATH:./' >> .profile
    

    Restart bash session and voilà! Now echo $PATH should output :./ as the last item. Note that you definitely need to add it as the last item for security (e.g. against malicious ls.exe).

提交回复
热议问题