我已经在新的Windows 10计算机上安装了64位Git Bash 2.5.1:
mark@Foo MINGW64 ~/Documents/FsCheck (master)
$ git --version
git version 2.5.1.windows.1
当我列出目录的内容时,可以看到一个shell脚本:
mark@Foo MINGW64 ~/Documents/FsCheck (master)
$ ls
appveyor.yml build.cmd build.sh* Docs/
bin/ build.fsx Contributors.txt examples/ FsCheck.sln
(为清楚起见,删除了一些文件和文件夹。)
请注意,shell脚本build.sh
在扩展名后带有星号。在控制台中,它也是绿色,其他文件是浅灰色。我以前没看过这个,所以我不知道这有什么意义。
当我尝试运行脚本时,出现错误消息:
mark@Foo MINGW64 ~/Documents/FsCheck (master)
$ build.sh
bash: build.sh: command not found
另外,任何build
文件都没有制表符补全。
如何从Git Bash运行shell脚本?
您可能已经ls
别名为ls -F
。因此,当出现星号时,表示该文件是可执行文件。
在POSIX系统中,出于安全原因,您不能直接执行当前目录中的文件。如果愿意,可以使用以下技巧:
./build.sh
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句