Cygwin Bash from Windows Cmd Not Running Executable
bash, cygwin, exe, windows
Solution
You may try `-c <command >`
D:\cygwin\bin\bash --login -c C:/ILS/trunk/NAVAID/test.exe
This runs test.exe under a bash shell. Details on -c option
There are several single-character options that may be supplied at invocation which are not available with the set builtin.
-c string Read and execute commands from string after processing the options, then exit. Any remaining arguments are assigned to the positional parameters, starting with $0.
`-i` starts an interactive shell, that is not something you want in this case.
Finally for the sake of completion - bash has `--rcfile <file path>` option to give a startup file.
Problem
I have a program I've compiled in cygwin, that I am trying to call from a batch file a la: ``` D:\cygwin\bin\bash --login -i C:/ILS/trunk/NAVAID/test.exe ``` But I am getting the error: ``` bash: C:/ILS/trunk/NAVAID/test.exe: cannot execute binary file ``` When I file test.exe inside cygwin, I get: ``` test.exe: PE32 executable (console) Intel 80386, for MS Windows ``` Any ideas why it won't run? Most of the errors I've found online are from people trying to run Linux apps, but this is something compiled (via g++) directly in cygwin (on the same machine). On Windows 8 if it matters.