From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129771 invoked by alias); 2 Feb 2018 09:17:22 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 129543 invoked by uid 89); 2 Feb 2018 09:16:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=H*M:local, H*RU:14.03.0361.001, Hx-spam-relays-external:14.03.0361.001, H*r:14.03.0361.001 X-HELO: outmail148113.authsmtp.com Received: from outmail148113.authsmtp.com (HELO outmail148113.authsmtp.com) (62.13.148.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Feb 2018 09:16:48 +0000 Received: from mail-c247.authsmtp.com (mail-c247.authsmtp.com [62.13.128.247]) by punt24.authsmtp.com. (8.15.2/8.15.2) with ESMTP id w129Gkon080749 for ; Fri, 2 Feb 2018 09:16:46 GMT (envelope-from David.Allsopp@cl.cam.ac.uk) Received: from romulus.metastack.com (114.212-105-213.static.virginmediabusiness.co.uk [213.105.212.114]) (authenticated bits=0) by mail.authsmtp.com (8.15.2/8.15.2) with ESMTPSA id w129GhYu073637 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 2 Feb 2018 09:16:45 GMT (envelope-from David.Allsopp@cl.cam.ac.uk) Received: from remus.metastack.local (remus.metastack.com [172.16.0.1]) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id w129GhwX007505 for ; Fri, 2 Feb 2018 09:16:43 GMT Received: from Remus.metastack.local ([fe80::547c:3c42:e1da:eda2]) by Remus.metastack.local ([fe80::547c:3c42:e1da:eda2%10]) with mapi id 14.03.0361.001; Fri, 2 Feb 2018 09:16:42 +0000 From: David Allsopp To: "cygwin@cygwin.com" Subject: RE: How to start Cygwin from outside Cygwin and pass a command to execute? Date: Fri, 02 Feb 2018 09:17:00 -0000 Message-ID: References: <4df6f54b-5898-76f9-ebf6-1a2e40c65aa5@yahoo.co.uk> In-Reply-To: <4df6f54b-5898-76f9-ebf6-1a2e40c65aa5@yahoo.co.uk> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Server-Quench: ca3bf167-07f9-11e8-8106-0015176ca198 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd1ZAARAlZ5RRob BmUtCCtbTh09DhZI RxQKKE1TKxwUVhJa I0lFL1x7O0wTWlBf HTVUBhpUUkIHDDFq aQpQZRVda0BPWQ9u VQZLQ1FMFQVtHx4A BAAfUx1tdQBZeTA3 ZERrKSgyGUR9dkB+ RQBVHGoPKzQxazJJ UUZfagNTJgpXfx4Q Yk13VXMLfGUHZ39h QFE4NmlgbSNlBXYd YgYSZU4VCV0XFyQg DzsTEiouGwULXSI2 Zxs7NkUdEEtZGVQ9 LlonEVseP1cKAxZF V0gFCyhcIlAHS2I3 CmESUF4TGyBBTHA0 X-Authentic-SMTP: 61633634383431.1038:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 213.105.212.114/25 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00011.txt.bz2 Ben via cygwin wrote: > Assume my CgyWin (on a windows 7) is currently NOT started. >=20 > Assume I want to call from Windows my CgyWin and pass a command to=20 > execute. >=20 > Afterwards CygWin should automatically be closed again. >=20 > 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 term= inal emulator, instead of using an existing console window, or opening a ne= w one). Similar fun with escaping unusual commands. See, for example, https://github.com/ocaml/opam/blob/43e4c778/appveyor_buil= d.cmd#L93 David -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple