RE: How to start Cygwin from outside Cygwin and pass a command to execute?
- Date: Fri, 2 Feb 2018 09:16:42 +0000
- From: David Allsopp <David.Allsopp@xxxxxxxxxxxx>
- Subject: RE: How to start Cygwin from outside Cygwin and pass a command to execute?
Ben via cygwin wrote:
> Assume my CgyWin (on a windows 7) is currently NOT started.
> Assume I want to call from Windows my CgyWin and pass a command to
> Afterwards CygWin should automatically be closed again.
> How can I achieve this?
C:\cygwin\bin\bash.exe -c "command"
You will find that successfully navigating the Command Prompt, Cygwin's and "bash -c"'s escaping rules to be entertaining for advanced commands.
You can also achieve similar with mintty.exe -e (which will launch the terminal emulator, instead of using an existing console window, or opening a new one). Similar fun with escaping unusual commands.
See, for example, https://github.com/ocaml/opam/blob/43e4c778/appveyor_build.cmd#L93
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple