How to run a program in git-bash.exe in a new window

12,113

If git-bash.exe is compatible with bash you will need:

git-bash.exe -c /c/Users/PetrKrysl/AppData/Local/Julia-1.0.1/bin/julia.exe

Omitting the -c causes the file parameter to be interpreted as a text file containing bash commands, and a binary file is not allowed, as you observed.

The same error is generated if you try to execute a binary program with the source or . command from a running bash.

Share:
12,113

Related videos on Youtube

Petr Krysl
Author by

Petr Krysl

Updated on September 18, 2022

Comments

  • Petr Krysl
    Petr Krysl over 1 year

    When I run the program /c/Users/PetrKrysl/AppData/Local/Julia-1.0.1/bin/julia.exe in an open git-bash.exe window, it runs fine.  However, I'm not able to start a new window with

    git-bash.exe /c/Users/PetrKrysl/AppData/Local/Julia-1.0.1/bin/julia.exe
    

    A window opens, but doesn't stay open. There is some sort of error message, but the window vanishes too quickly for me to read what happened.

    • Biswapriyo
      Biswapriyo over 5 years
      Use this option --hold always with git-bash.exe command. If you find any error add that in your question.
    • Petr Krysl
      Petr Krysl over 5 years
      I'm afraid that didn't work. The window still closed immediately. (I used this as git-bash.exe --hold always /c/Users/PetrKrysl/AppData/Local/Julia-1.0.1/bin/julia.exe. I hope that was what you intended?)
    • Biswapriyo
      Biswapriyo over 5 years
      The capture a video and play it slowly.
    • Petr Krysl
      Petr Krysl over 5 years
      Excellent idea! The error message is bash: /c/Users/PetrKrysl/AppData/Local/Julia-1.0.1/bin/julia.exe: cannot execute binary file
    • AFH
      AFH over 5 years
      If git-bash.exe is compatible with bash you will need git-bash.exe -c /c/Users/PetrKrysl/AppData/Local/Julia-1.0.1/bin/julia.exe. Omitting the -c causes the file parameter to be interpreted as a text file containing bash commands, and a binary file is not allowed, as you observed..
    • Petr Krysl
      Petr Krysl over 5 years
      Fantastic, that was it! Thank you very much indeed. Petr
    • AFH
      AFH over 5 years
      I have submitted an answer, so that others can see that it is solved, provided that you accept it.