Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sources.redhat.com/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Does anyone know how to invoke a bash process via a dos batch program so commands after bash execute? Date: Tue, 13 Apr 2004 14:02:58 -0400 Message-ID: <E6292146029E2943934457D3F16DA44A405BB6@bkexch112.msdwis.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Lipin, Adam" <Adam DOT Lipin AT morganstanley DOT com> To: "Dave Korn" <dk AT artimi DOT com>, <cygwin AT cygwin DOT com> X-OriginalArrivalTime: 13 Apr 2004 18:02:58.0745 (UTC) FILETIME=[8DD7E290:01C42181] X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i3DI3EWj022362 That works. Thanks a lot. -----Original Message----- From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Dave Korn Sent: Tuesday, April 13, 2004 11:03 AM To: cygwin AT cygwin DOT com Subject: RE: Does anyone know how to invoke a bash process via a dos batch program so commands after bash execute? > -----Original Message----- > From: cygwin-owner On Behalf Of Lipin, Adam > Sent: 13 April 2004 15:44 > The problem isn't calling bash. I can call bash without a problem. The > problem is that I call bash then it executes bash and gives me a > prompt and then stops. It does not run any commands after executing > bash. Whether I run bash.bat or bash.exe. In fact, that's exactly what you'd expect, come to think of it. When cmd.exe processes a command in a batch file, it doesn't redirect the contents of the batch file into the stdin for that command. It executes the command program and waits for it to complete before reading more of the batch file. You wouldn't expect this to work, would you: -----wont_work.bat----- notepad.exe Hello, this will NOT end up as text in the notepad document -----wont_work.bat----- cmd.exe doesn't understand that bash.exe is a command shell, it just treats it like any other program that's called from a batch file, and in particular it doesn't pipe any input to it, from the batch file or anywhere else. To get the effect you want, you should really put the bash commands into a separate file and then use "bash -s < filename" (or even "cat filename | bash -s" I suppose). If you want to keep things localized in the one file, you could use echo instructions to build a temporary script file. It's a shame that cmd.exe doesn't support here docs. cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ **** Important Notice to Recipients **** It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley. **************************************** -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/