This is the mail archive of the
mailing list for the Cygwin project.
RE: How to start Cygwin from outside Cygwin and pass a command to execute?
- From: David Allsopp <David dot Allsopp at cl dot cam dot ac dot uk>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Fri, 2 Feb 2018 09:16:42 +0000
- Subject: RE: How to start Cygwin from outside Cygwin and pass a command to execute?
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com>
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