Unable to find bash.exe executable when using MinGW

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

When running a Bash script on a 64-bit Windows 10 machine with MinGW installed, the following error appears in the job log:

Unable to find executable at /usr/bin/bash.exe. Will try to run it anyway.

Diagnosis

Environment

  • Windows 10
  • MinGW 64
  • Bash Script

Diagnostic Steps

  • Please check the Shebang line of the script; eg:

    #!/usr/bin/bash.exe

    – this article applies if the path to bash.exe is in Unix format.

Cause

Even though /usr/bin/bash exists, it cannot be found by the agent's Shell interpreter.

Resolution

Change the Shebang line to use the Windows style path to bash.exe. For example:

#!C:\msys64\usr\bin\bash.exe
Last modified on Aug 6, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.