Mark Seemann Mark Seemann - 1 year ago 134
Git Question

Shell scripts with Git Bash 64-bit on Windows

I've installed Git Bash 2.5.1 64-bit on a fresh Windows 10 machine:

mark@Foo MINGW64 ~/Documents/FsCheck (master)
$ git --version
git version

When I list the contents of a directory, I can see a shell script:

mark@Foo MINGW64 ~/Documents/FsCheck (master)
$ ls
appveyor.yml build.cmd* Docs/
bin/ build.fsx Contributors.txt examples/ FsCheck.sln

(Some files and folders removed for clarity.)

Notice that the shell script
has an asterisk after the extension. In the console, it's also coloured green, where other files are light grey. I haven't seen this before, so I don't know if it means anything.

When I try to run the script, I get an error message:

mark@Foo MINGW64 ~/Documents/FsCheck (master)
bash: command not found

Also, there's no tab completion for any of the

How can I run the shell script from Git Bash?

Answer Source

You probably have ls aliased to ls -F. So when an trailing asterisk appears that means that the file is executable.

In POSIX systems, you can't directly execute files in current directory (for safety reasons). If you want to, you can use this trick:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download