From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25331 invoked by alias); 5 Jan 2009 11:27:12 -0000 Received: (qmail 25321 invoked by uid 22791); 5 Jan 2009 11:27:12 -0000 X-SWARE-Spam-Status: No, hits=2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64,RCVD_IN_CHINA,RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Jan 2009 11:27:08 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LJnbs-0000dV-8K for cygwin@cygwin.com; Mon, 05 Jan 2009 11:27:04 +0000 Received: from 159.226.135.215 ([159.226.135.215]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Jan 2009 11:27:04 +0000 Received: from hongyi.zhao by 159.226.135.215 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Jan 2009 11:27:04 +0000 To: cygwin@cygwin.com From: Hongyi Zhao Subject: Re: Trick cmd.exe of Windows XP to run cygwin Batch Script. Date: Mon, 05 Jan 2009 12:43:00 -0000 Message-ID: <9up3m4hudhdfrourtmnmsiust0bs8jq0l5@4ax.com> References: <20090104110730.GH4017@trikaliotis.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2009-01/txt/msg00100.txt.bz2 On Sun, 4 Jan 2009 12:07:31 +0100, Spiro Trikaliotis wrote: >d:\> bash -c ./myscript I've tested the above code and work it out like this: set cygwin_bin=C:\cygwin\bin %cygwin_bin%\bash -l %~dp0myscript > myresult In the above example by me, we need to pay attention to the following matters: 1- %~dp0myscript mean that the file myscript is located at the same directory as the bat file, i.e, the batch file which include the above patch codes I posted here. This batch file will invoke the bash script file myscript. 2- the -c parameter used by you shouldn't be used here, if I used it, I will meet the errors like this: ... command not found 3- The --login or -l must be used here, otherewise the following error will be occur like this: myscript: line 1: awk : command not found 4- The path name conventions in the invoking of this batch file, the dos rule, i.e., _\_, should be used instead of the bash convention, i.e., _/_, as the delimitor of path. 5- In your case, >d:\> bash -c ./myscript actully, in the usage, the file myscript must ba put into the bash's directory, i.e., C:\cygwin\bin. This is not a convenient solution. Regards, -- .: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :. -- 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/