X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; q=dns; s=default; b=MrOag4X J4FRLFUBkDFiD2Mz/ZH1/92KSQRSvEYwZs/KgxoXmcaqiGGZoxZRi/K8Utb6dYSd bHaW8DewQ3ZYq8YnkAjTkPD9uSeT983P9AsS9qxEqqeunR4kMpZK8Okd7R4iSN/Y 3z+Nu1mRzIZVNULOHGCaVzr2RmZ2X9Bl0RNw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; s=default; bh=YajmcMzScMjBL 9Yfzp8vVmmRoSg=; b=LtBT5mDzuJSDeUzTb4xtFG2IDKGmnwQXXYkjgUjev3L0m Niklcm10gdq5rFqaRhhhDq7wpfBp98U4ANXoOUhZtfPKeCKodlrukODWr7UTiba/ yJkh4MbMo/8rG2L+8unWGiK85Yd7PFdWvmiqrPSix68cUR+aTSjSbw/f5PEjoI= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: Yes, score=5.9 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,FREEMAIL_REPLY,NO_RELAYS,SPAM_SUBJECT autolearn=no version=3.3.2 X-HELO: mail-pb0-f54.google.com X-Received: by 10.68.197.129 with SMTP id iu1mr14540442pbc.139.1380144343161; Wed, 25 Sep 2013 14:25:43 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1296293740.20130925211640@mtu-net.ru> References: <1296293740 DOT 20130925211640 AT mtu-net DOT ru> From: Ulrich Pogson Date: Wed, 25 Sep 2013 23:25:23 +0200 Message-ID: Subject: Re: Run bash script in cmd with cygwin To: Andrey Repin Content-Type: text/plain; charset=ISO-8859-1 Thanks for your help I got it to work with this line. I: & cd I:\Work\GitHub\responsive\languages & c:\cygwin64\bin\bash -c \cygdrive\i\Work\GitHub\responsive\languages\potomo.sh and this file. https://gist.github.com/grappler/6704735 On 25 September 2013 19:16, Andrey Repin wrote: > Greetings, Ulrich Pogson! > >> I would like to run this script `for file in `find . -name "*.po"` ; >> do msgfmt -o ${file/.po/.mo} $file ; done` in windows cmd. > > I think you mean "command line" and not a "script". > This is not realistically possible. Windows CMD do not have as straightforward > quoting and escaping rules, as you might wish for it to have. > Your only safe bet is to actually write a script and execute it from cmd, when > need. > >> The script need to run in a different folder. I have been able to run it >> though cygwin but want to integrate it with another system where it will be >> run through cmd. > >> C:\cygwin\bin >> D:\path\to\dir > >> How can I do this? > > The association: > > FTYPE unixshell.script="%CygwinDir%\bin\env.exe" "%1" %* > ASSOC .sh=unixshell.script > > then your find-poo.sh > > #! /bin/sh > for file in $(find . -name "*.po") > do msgfmt -o ${file/.po/.mo} $file > done > > > -- > WBR, > Andrey Repin (anrdaemon AT yandex DOT ru) 25.09.2013, <21:05> > > Sorry for my terrible english... > -- 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