How do i start Mintty and run a script file?

nkman picture nkman · Apr 12, 2013 · Viewed 19.6k times · Source

I wrote a simple CURL and put it in a script file.

if i run mintty first and then "test.sh" it runs the script in the file just fine. Works perfectly.

however, if i try to run mintty with any of the following command line, it will not run. I'm running these in CMD

C:\>c:\cygwin\bin\mintty.exe --exec '/cygdrive/c/cygwin/bin/test.sh'

C:\>c:\cygwin\bin\mintty.exe --exec '/bin/test.sh'

C:\>c:\cygwin\bin\mintty.exe --exec '/test.sh'

C:\>c:\cygwin\bin\mintty.exe --exec 'test.sh'

C:\>c:\cygwin\bin\mintty.exe --exec 'c:/test.sh'

C:\>c:\cygwin\bin\mintty.exe --exec 'c:\test.sh'

Answer

nkman picture nkman · Apr 12, 2013

For whoever is interested in this... here is the solution

Create a shortcut in windows for mintty with the following target

Assuming your shell file is located in c:\cygwin\bin

C:\cygwin\bin\mintty.exe /bin/bash -l -e '/cygdrive/c/cygwin/bin/test.sh'